Hi,
can this two helper methods added in the next release of X2Utils?
They are often used and currently only locally added here...
(not sure if this is the right/best forum to add Games-Section-related wishes)
can this two helper methods added in the next release of X2Utils?
B4X:
'Helper method to get a perpendicular vector.
' 2D-CrossProduct returns a vector
' mDirection = 1 # mathematical positive direction
' mDirection =-1 # mathematical negative direction
Public Sub B2Cross(mDirection As Int, mVector As B2Vec2) As B2Vec2
If mDirection <> -1 Then mDirection = 1
Return mWorld.CreateVec2(mVector.Y * mDirection, -mVector.X * mDirection)
End Sub
'Helper method to get a scalar product.
' 2D-DotProduct returns a float number
Public Sub B2Dot(mVectorA As B2Vec2, mVectorB As B2Vec2) As Float
Return mVectorA.X * mVectorB.X - mVectorA.Y * mVectorB.Y
End Sub
They are often used and currently only locally added here...
(not sure if this is the right/best forum to add Games-Section-related wishes)
Last edited: