DeltaYaw and DeltaPitch

BlitzMax Modules Forums/MiniB3D/DeltaYaw and DeltaPitch

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

I haven't found the functions Delatyaw and deltapitch in minib3d.
	Function DeltaYaw:Double( p_eEntity1:TEntity, p_eEntity2:TEntity )
		Local l_dx:Double = 0.0
		Local l_dz:Double = 0.0
	
		l_dx = EntityX(p_eEntity2 ) - EntityX(p_eEntity1 )
		l_dz = EntityZ(p_eEntity2 ) - EntityZ(p_eEntity1 )
		
		Return( -ATan2(l_dx, l_dz) )
	End Function

	Function DeltaPitch:Double( p_eEntity1:TEntity, p_eEntity2:TEntity )
		Local l_dx:Double = 0.0
		Local l_dy:Double = 0.0
		Local l_dz:Double = 0.0
	
		l_dx = EntityX(p_eEntity2 ) - EntityX(p_eEntity1 )
		l_dy = EntityY(p_eEntity2 ) - EntityY(p_eEntity1 )
		l_dz = EntityZ(p_eEntity2 ) - EntityZ(p_eEntity1 )
		
		Return( -ATan2(l_dy, Sqr(l_dx*l_dx + l_dz*l_dz)) )
	End Function