# Help needed: Making plane with E2

Ok so I’m making a plane with E2:

my problems are this:

PART3:

How do I simulate the stabilisers ( tail plane and fin), ie prevent latteral movement, using the vectors and applyforce?

So far my code is this:

``````

@name
@inputs ConPit ConYaw ConRoll Power FlowSpeed
@outputs PlaneAngle:angle Lift
@persist V:vector Ang:angle AngV:angle Vector:vector AntiWeight:vector
@trigger all

runOnTick(1)

EE   = entity()

Ang  = EE:angles():setYaw(0):setRoll(0):setPitch(0)
AngV = EE:angVel()
Inertia = shiftL(ang(entity():inertia()))

ConAng = ang(ConPit, ConYaw, ConRoll)
applyAngForce(-(Ang*25 + ConAng*300 + AngV*30)*Inertia)
#TargetPos=owner():pos()+vec(30,30,30)

PlaneAngle = EE:angles()

CurrentPos = EE:pos():setX(0):setY(0):setZ(0)

D = (EE:vel()):dot((EE:vel()))

Vel = EE:vel():setX(D)

Vector = -Vel
Mass = EE:mass()

#(0.8*Vector*Mass)
#Speed of flow over aerofoil -> freestream velocity = U
applyForce(Vector*Mass)

D = (FlowSpeed^2)*0.0001
Lift = D
#Lift = vec(PlaneAngle)*D

#Vector = AntiWeight + Lift + Thrust
#applyForce(Vector*Mass)

``````

help pliz?

I need to find the vector N which is parrallel to the plane A
Ent:forward() returns the forward direction vector of an entity.
There is also
Ent:right()
Ent:up()

Using the vector N, I should simply be able to multiply it by a constant, to give me a simulation of thrust. Am I right?
Yep

Local coordinates??
This will calculate the upward lift provided by the wing:

``````
Lift = Ent:up() * Ent:vel():length() * Multiplier

``````

So yeah this is all a lot simpler than you seem to think.
Also: http://wiki.garrysmod.com/?title=Wire_Expression2

Oh and by the way, seeing as most of the users on this forum are not programmers, do not know math and some are just plain stupid (no offence), this is the place to ask help regarding E2 programming: http://www.wiremod.com/forum/expression-help/
Just so you know that in the future.

whoh my brain just went dead

WTF IS THIS ROCKET SCIENCE?

HAIL PHYSICS

sur I study rocket science surr <:|D