Airplane Physics

Blitz3D Forums/Blitz3D Programming/Airplane Physics

You need to calculate the force of the propeller and wings depending on their angle but you need to do it in all 3 dimensions. In Aerial Antics (the version on Garage Games) the jets pitch changes and depending on the pitch the thrust applies acceleration along a certain vector. Now in that game it only applies the force according to the yaw of the player and the pitch of the jets. With a plane you'd also need to calculate the velocity with regard to the roll of the plane (for the wings). It's pretty basic trigonometry to calculate the forces and components that need to be applied to accelerate the player. These should get you started ... easy for the propeller, for the wings and rudder it'll take a bit more thought but the idea is all the same ... a bunch of vectors all over the place adding up to one big vector.

;====== VECTOR FUNCTIONS ==================================================

Function vectorXComponent#(angle#,force#)
	Return force# * Cos(angle#)	
End Function

Function vectorZComponent#(angle#,force#)
	Return force# * Sin(angle#)
End Function

Function vectorYComponent#(angle#,force#)
	Return force# * Cos(angle#)
End Function

Function vectorRemainderYComponent#(angle#,force#)
	Return force# * Sin(angle#)
End Function

;==========================================================================