|
@@ -13,7 +13,7 @@ Public
|
|
|
#end
|
|
|
Class Entity Extension
|
|
|
|
|
|
- #rem monkeydoc Local rotation in degrees.
|
|
|
+ #rem monkeydoc Local space rotation in degrees.
|
|
|
#end
|
|
|
Property Rotation:Vec3f()
|
|
|
|
|
@@ -24,18 +24,90 @@ Class Entity Extension
|
|
|
Basis=Mat3f.Rotation( rotation * DegreesToRadians )
|
|
|
End
|
|
|
|
|
|
- #rem monkeydoc World rotation in degrees.
|
|
|
+ #rem monkeydoc Local space rotation in degrees.
|
|
|
#end
|
|
|
- Property WorldRotation:Vec3f()
|
|
|
+ Property LocalRotation:Vec3f()
|
|
|
|
|
|
- Return WorldBasis.GetRotation() * RadiansToDegrees
|
|
|
+ Return LocalBasis.GetRotation() * RadiansToDegrees
|
|
|
|
|
|
Setter( rotation:Vec3f )
|
|
|
|
|
|
- WorldBasis=Mat3f.Rotation( rotation * DegreesToRadians )
|
|
|
+ Basis=Mat3f.Rotation( rotation * DegreesToRadians )
|
|
|
End
|
|
|
|
|
|
- #rem monkeydoc X coordinate of local position.
|
|
|
+ #Rem monkeydoc World space rotation around the X axis in degrees.
|
|
|
+ #End
|
|
|
+ Property Rx:Float()
|
|
|
+
|
|
|
+ Return Rotation.x
|
|
|
+
|
|
|
+ Setter( rx:Float )
|
|
|
+
|
|
|
+ Local r:=Rotation
|
|
|
+ Rotation=New Vec3f( rx,r.y,r.z )
|
|
|
+ End
|
|
|
+
|
|
|
+ #Rem monkeydoc World space rotation around the Y axis in degrees.
|
|
|
+ #End
|
|
|
+ Property Ry:Float()
|
|
|
+
|
|
|
+ Return Rotation.y
|
|
|
+
|
|
|
+ Setter( ry:Float )
|
|
|
+
|
|
|
+ Local r:=Rotation
|
|
|
+ Rotation=New Vec3f( r.x,ry,r.z )
|
|
|
+ End
|
|
|
+
|
|
|
+ #Rem monkeydoc World space rotation around the Z axis in degrees.
|
|
|
+ #End
|
|
|
+ Property Rz:Float()
|
|
|
+
|
|
|
+ Return Rotation.z
|
|
|
+
|
|
|
+ Setter( rz:Float )
|
|
|
+
|
|
|
+ Local r:=Rotation
|
|
|
+ Rotation=New Vec3f( r.x,r.y,rz )
|
|
|
+ End
|
|
|
+
|
|
|
+ #Rem monkeydoc Local space rotation around the X axis in degrees.
|
|
|
+ #End
|
|
|
+ Property LocalRx:Float()
|
|
|
+
|
|
|
+ Return LocalRotation.x
|
|
|
+
|
|
|
+ Setter( rx:Float )
|
|
|
+
|
|
|
+ Local r:=LocalRotation
|
|
|
+ LocalRotation=New Vec3f( rx,r.y,r.z )
|
|
|
+ End
|
|
|
+
|
|
|
+ #Rem monkeydoc Local space rotation around the Y axis in degrees.
|
|
|
+ #End
|
|
|
+ Property LocalRy:Float()
|
|
|
+
|
|
|
+ Return LocalRotation.y
|
|
|
+
|
|
|
+ Setter( ry:Float )
|
|
|
+
|
|
|
+ Local r:=LocalRotation
|
|
|
+ LocalRotation=New Vec3f( r.x,ry,r.z )
|
|
|
+ End
|
|
|
+
|
|
|
+ #Rem monkeydoc Local space rotation around the Z axis in degrees.
|
|
|
+ #End
|
|
|
+ Property LocalRz:Float()
|
|
|
+
|
|
|
+ Return LocalRotation.z
|
|
|
+
|
|
|
+ Setter( rz:Float )
|
|
|
+
|
|
|
+ Local r:=LocalRotation
|
|
|
+ LocalRotation=New Vec3f( r.x,r.y,rz )
|
|
|
+ End
|
|
|
+
|
|
|
+ #rem monkeydoc World space X coordinate.
|
|
|
#end
|
|
|
Property X:Float()
|
|
|
|
|
@@ -47,7 +119,7 @@ Class Entity Extension
|
|
|
Position=New Vec3f( x,v.y,v.z )
|
|
|
End
|
|
|
|
|
|
- #rem monkeydoc Y coordinate of local position.
|
|
|
+ #rem monkeydoc World space Y coordinate.
|
|
|
#end
|
|
|
Property Y:Float()
|
|
|
|
|
@@ -59,7 +131,7 @@ Class Entity Extension
|
|
|
Position=New Vec3f( v.x,y,v.z )
|
|
|
End
|
|
|
|
|
|
- #rem monkeydoc Z coordinate of local position.
|
|
|
+ #rem monkeydoc World space Z coordinate.
|
|
|
#end
|
|
|
Property Z:Float()
|
|
|
|
|
@@ -71,115 +143,43 @@ Class Entity Extension
|
|
|
Position=New Vec3f( v.x,v.y,z )
|
|
|
End
|
|
|
|
|
|
- #rem monkeydoc X coordinate of world position.
|
|
|
+ #rem monkeydoc Local space X coordinate.
|
|
|
#end
|
|
|
- Property WorldX:Float()
|
|
|
+ Property LocalX:Float()
|
|
|
|
|
|
- Return WorldPosition.x
|
|
|
+ Return LocalPosition.x
|
|
|
|
|
|
Setter( x:Float )
|
|
|
|
|
|
- Local v:=WorldPosition
|
|
|
- WorldPosition=New Vec3f( x,v.y,v.z )
|
|
|
+ Local v:=LocalPosition
|
|
|
+ LocalPosition=New Vec3f( x,v.y,v.z )
|
|
|
End
|
|
|
|
|
|
- #rem monkeydoc Y coordinate of world position.
|
|
|
+ #rem monkeydoc Local space Y coordinate.
|
|
|
#end
|
|
|
- Property WorldY:Float()
|
|
|
+ Property LocalY:Float()
|
|
|
|
|
|
- Return WorldPosition.y
|
|
|
+ Return LocalPosition.y
|
|
|
|
|
|
Setter( y:Float )
|
|
|
|
|
|
- Local v:=WorldPosition
|
|
|
- WorldPosition=New Vec3f( v.x,y,v.z )
|
|
|
+ Local v:=LocalPosition
|
|
|
+ LocalPosition=New Vec3f( v.x,y,v.z )
|
|
|
End
|
|
|
|
|
|
- #rem monkeydoc Z coordinate of world position.
|
|
|
+ #rem monkeydoc Local space Z coordinate.
|
|
|
#end
|
|
|
- Property WorldZ:Float()
|
|
|
+ Property LocalZ:Float()
|
|
|
|
|
|
- Return WorldPosition.z
|
|
|
+ Return LocalPosition.z
|
|
|
|
|
|
Setter( z:Float )
|
|
|
|
|
|
- Local v:=WorldPosition
|
|
|
- WorldPosition=New Vec3f( v.x,v.y,z )
|
|
|
- End
|
|
|
-
|
|
|
- #Rem monkeydoc Rotation around the X axis in degrees.
|
|
|
- #End
|
|
|
- Property Rx:Float()
|
|
|
-
|
|
|
- Return Rotation.x
|
|
|
-
|
|
|
- Setter( rx:Float )
|
|
|
-
|
|
|
- Local r:=Rotation
|
|
|
- Rotation=New Vec3f( rx,r.y,r.z )
|
|
|
- End
|
|
|
-
|
|
|
- #Rem monkeydoc Rotation around the Y axis in degrees.
|
|
|
- #End
|
|
|
- Property Ry:Float()
|
|
|
-
|
|
|
- Return Rotation.y
|
|
|
-
|
|
|
- Setter( ry:Float )
|
|
|
-
|
|
|
- Local r:=Rotation
|
|
|
- Rotation=New Vec3f( r.x,ry,r.z )
|
|
|
- End
|
|
|
-
|
|
|
- #Rem monkeydoc Rotation around the X axis in degrees.
|
|
|
- #End
|
|
|
- Property Rz:Float()
|
|
|
-
|
|
|
- Return Rotation.z
|
|
|
-
|
|
|
- Setter( rz:Float )
|
|
|
-
|
|
|
- Local r:=Rotation
|
|
|
- Rotation=New Vec3f( r.x,r.y,rz )
|
|
|
- End
|
|
|
-
|
|
|
- #Rem monkeydoc Rotation around the X axis in degrees.
|
|
|
- #End
|
|
|
- Property WorldRx:Float()
|
|
|
-
|
|
|
- Return WorldRotation.x
|
|
|
-
|
|
|
- Setter( rx:Float )
|
|
|
-
|
|
|
- Local r:=WorldRotation
|
|
|
- WorldRotation=New Vec3f( rx,r.y,r.z )
|
|
|
- End
|
|
|
-
|
|
|
- #Rem monkeydoc Rotation around the Y axis in degrees.
|
|
|
- #End
|
|
|
- Property WorldRy:Float()
|
|
|
-
|
|
|
- Return WorldRotation.y
|
|
|
-
|
|
|
- Setter( ry:Float )
|
|
|
-
|
|
|
- Local r:=WorldRotation
|
|
|
- WorldRotation=New Vec3f( r.x,ry,r.z )
|
|
|
- End
|
|
|
-
|
|
|
- #Rem monkeydoc Rotation around the X axis in degrees.
|
|
|
- #End
|
|
|
- Property WorldRz:Float()
|
|
|
-
|
|
|
- Return WorldRotation.z
|
|
|
-
|
|
|
- Setter( rz:Float )
|
|
|
-
|
|
|
- Local r:=WorldRotation
|
|
|
- WorldRotation=New Vec3f( r.x,r.y,rz )
|
|
|
+ Local v:=LocalPosition
|
|
|
+ LocalPosition=New Vec3f( v.x,v.y,z )
|
|
|
End
|
|
|
|
|
|
- #rem monkeydoc Scale on the x axis.
|
|
|
+ #rem monkeydoc World space scale on the X axis.
|
|
|
#end
|
|
|
Property Sx:Float()
|
|
|
|
|
@@ -191,7 +191,7 @@ Class Entity Extension
|
|
|
Scale=New Vec3f( sx,s.y,s.z )
|
|
|
End
|
|
|
|
|
|
- #rem monkeydoc Scale on the y axis.
|
|
|
+ #rem monkeydoc World space scale on the Y axis.
|
|
|
#end
|
|
|
Property Sy:Float()
|
|
|
|
|
@@ -203,7 +203,7 @@ Class Entity Extension
|
|
|
Scale=New Vec3f( s.x,sy,s.z )
|
|
|
End
|
|
|
|
|
|
- #rem monkeydoc Scale on the z axis.
|
|
|
+ #rem monkeydoc World space scale on the Z axis.
|
|
|
#end
|
|
|
Property Sz:Float()
|
|
|
|
|
@@ -212,123 +212,120 @@ Class Entity Extension
|
|
|
Setter( sz:Float )
|
|
|
|
|
|
Local s:=Scale
|
|
|
-
|
|
|
Scale=New Vec3f( s.x,s.y,sz )
|
|
|
End
|
|
|
|
|
|
- #rem monkeydoc Scale on the x axis.
|
|
|
+ #rem monkeydoc Local space scale on the X axis.
|
|
|
#end
|
|
|
- Property WorldSx:Float()
|
|
|
+ Property LocalSx:Float()
|
|
|
|
|
|
- Return WorldScale.x
|
|
|
+ Return LocalScale.x
|
|
|
|
|
|
Setter( sx:Float )
|
|
|
|
|
|
- Local s:=WorldScale
|
|
|
+ Local s:=LocalScale
|
|
|
|
|
|
- WorldScale=New Vec3f( sx,s.y,s.z )
|
|
|
+ LocalScale=New Vec3f( sx,s.y,s.z )
|
|
|
End
|
|
|
|
|
|
- #rem monkeydoc Scale on the y axis.
|
|
|
+ #rem monkeydoc Local space scale on the Y axis.
|
|
|
#end
|
|
|
- Property WorldSy:Float()
|
|
|
+ Property LocalSy:Float()
|
|
|
|
|
|
- Return WorldScale.y
|
|
|
+ Return LocalScale.y
|
|
|
|
|
|
Setter( sy:Float )
|
|
|
|
|
|
- Local s:=WorldScale
|
|
|
-
|
|
|
- WorldScale=New Vec3f( s.x,sy,s.z )
|
|
|
+ Local s:=LocalScale
|
|
|
+ LocalScale=New Vec3f( s.x,sy,s.z )
|
|
|
End
|
|
|
|
|
|
- #rem monkeydoc Scale on the z axis.
|
|
|
+ #rem monkeydoc Local space scale on the Z axis.
|
|
|
#end
|
|
|
- Property WorldSz:Float()
|
|
|
+ Property LocalSz:Float()
|
|
|
|
|
|
- Return WorldScale.z
|
|
|
+ Return LocalScale.z
|
|
|
|
|
|
Setter( sz:Float )
|
|
|
|
|
|
- Local s:=WorldScale
|
|
|
-
|
|
|
- WorldScale=New Vec3f( s.x,s.y,sz )
|
|
|
+ Local s:=LocalScale
|
|
|
+ LocalScale=New Vec3f( s.x,s.y,sz )
|
|
|
End
|
|
|
|
|
|
- #rem monkeydoc Sets entity basis matrix in local or world space.
|
|
|
+ #rem monkeydoc Sets entity position in local or world space.
|
|
|
#end
|
|
|
- Method SetBasis( basis:Mat3f,worldSpace:Bool=False )
|
|
|
+ Method SetPosition( position:Vec3f,localSpace:Bool=False )
|
|
|
|
|
|
- If worldSpace WorldBasis=basis Else Basis=basis
|
|
|
+ If localSpace LocalPosition=position Else Position=position
|
|
|
End
|
|
|
|
|
|
- #rem monkeydoc Gets entity basis matrix in local or world space.
|
|
|
- #end
|
|
|
- method GetBasis:Mat3f( worldSpace:Bool=False )
|
|
|
+ Method SetPosition( x:Float,y:Float,z:Float,localSpace:Bool=False )
|
|
|
|
|
|
- Return worldSpace ? WorldBasis Else Basis
|
|
|
-
|
|
|
+ SetPosition( New Vec3f( x,y,z ),localSpace )
|
|
|
End
|
|
|
-
|
|
|
- #rem monkeydoc Sets entity position in local or world space.
|
|
|
+
|
|
|
+ #rem monkeydoc Gets entity position in local or world space.
|
|
|
#end
|
|
|
- Method SetPosition( position:Vec3f,worldSpace:Bool=False )
|
|
|
+ Method GetPostition:Vec3f( localSpace:Bool=False )
|
|
|
|
|
|
- If worldSpace WorldPosition=position Else Position=position
|
|
|
+ Return localSpace ? LocalPosition Else Position
|
|
|
End
|
|
|
|
|
|
- Method SetPosition( x:Float,y:Float,z:Float,worldSpace:Bool=False )
|
|
|
+ #rem monkeydoc Sets entity basis matrix in local or world space.
|
|
|
+ #end
|
|
|
+ Method SetBasis( basis:Mat3f,localSpace:Bool=False )
|
|
|
|
|
|
- SetPosition( New Vec3f( x,y,z ),worldSpace )
|
|
|
+ If localSpace LocalBasis=basis Else Basis=basis
|
|
|
End
|
|
|
|
|
|
- #rem monkeydoc Gets entity position in local or world space.
|
|
|
+ #rem monkeydoc Gets entity basis matrix in local or world space.
|
|
|
#end
|
|
|
- Method GetPostition:Vec3f( worldSpace:Bool=False )
|
|
|
+ method GetBasis:Mat3f( localSpace:Bool=False )
|
|
|
|
|
|
- Return worldSpace ? WorldPosition Else Position
|
|
|
- End
|
|
|
+ Return localSpace ? LocalBasis Else Basis
|
|
|
|
|
|
+ End
|
|
|
+
|
|
|
#rem monkeydoc Sets entity rotation in euler angles in local or world space.
|
|
|
#end
|
|
|
- Method SetRotation( rotation:Vec3f,worldSpace:Bool=False )
|
|
|
+ Method SetRotation( rotation:Vec3f,localSpace:Bool=False )
|
|
|
|
|
|
Local basis:=Mat3f.Rotation( rotation * DegreesToRadians )
|
|
|
|
|
|
- If worldSpace WorldBasis=basis Else Basis=basis
|
|
|
+ If localSpace LocalBasis=basis Else Basis=basis
|
|
|
End
|
|
|
|
|
|
- Method SetRotation( rx:Float,ry:Float,rz:Float,worldSpace:Bool=False )
|
|
|
+ Method SetRotation( rx:Float,ry:Float,rz:Float,localSpace:Bool=False )
|
|
|
|
|
|
- SetRotation( New Vec3f( rx,ry,rz ),worldSpace )
|
|
|
+ SetRotation( New Vec3f( rx,ry,rz ),localSpace )
|
|
|
End
|
|
|
|
|
|
#rem monkeydoc Gets entity rotation in euler angles in local or world space.
|
|
|
#end
|
|
|
- Method GetRotation:Vec3f( worldSpace:Bool=False )
|
|
|
+ Method GetRotation:Vec3f( localSpace:Bool=False )
|
|
|
|
|
|
- Local basis:=worldSpace ? WorldBasis Else Basis
|
|
|
+ Local basis:=localSpace ? LocalBasis Else Basis
|
|
|
|
|
|
Return basis.GetRotation() * RadiansToDegrees
|
|
|
End
|
|
|
|
|
|
#rem monkeydoc Sets entity scale in local or world space.
|
|
|
#end
|
|
|
- Method SetScale( scale:Vec3f,worldSpace:Bool=False )
|
|
|
+ Method SetScale( scale:Vec3f,localSpace:Bool=False )
|
|
|
|
|
|
- If worldSpace WorldScale=scale Else Scale=scale
|
|
|
+ If localSpace LocalScale=scale Else Scale=scale
|
|
|
End
|
|
|
|
|
|
- Method SetScale( sx:Float,sy:Float,sz:Float,worldSpace:Bool=False )
|
|
|
+ Method SetScale( sx:Float,sy:Float,sz:Float,localSpace:Bool=False )
|
|
|
|
|
|
- SetScale( New Vec3f( sx,sy,sz ),worldSpace )
|
|
|
+ SetScale( New Vec3f( sx,sy,sz ),localSpace )
|
|
|
End
|
|
|
|
|
|
#rem monkeydoc Gets entity scale in local or world space.
|
|
|
#end
|
|
|
- Method GetScale:Vec3f( worldSpace:Bool=False )
|
|
|
+ Method GetScale:Vec3f( localSpace:Bool=False )
|
|
|
|
|
|
- Return worldSpace ? WorldScale Else Scale
|
|
|
+ Return localSpace ? LocalScale Else Scale
|
|
|
End
|
|
|
|
|
|
#rem monkeydoc Moves the entity.
|
|
@@ -336,9 +333,9 @@ Class Entity Extension
|
|
|
Moves the entity relative to its current orientation.
|
|
|
|
|
|
#end
|
|
|
- Method Move( tv:Vec3f,worldSpace:Bool=False )
|
|
|
+ Method Move( tv:Vec3f,localSpace:Bool=False )
|
|
|
|
|
|
- If worldSpace WorldPosition+=tv Else Position+=Basis * tv
|
|
|
+ If localSpace LocalPosition+=tv Else Position+=Basis * tv
|
|
|
End
|
|
|
|
|
|
Method Move( tx:Float,ty:Float,tz:Float )
|
|
@@ -351,9 +348,9 @@ Class Entity Extension
|
|
|
Moves the entity relative to its current orientation.
|
|
|
|
|
|
#end
|
|
|
- Method MoveX( tx:Float,worldSpace:Bool=False )
|
|
|
+ Method MoveX( tx:Float,localSpace:Bool=False )
|
|
|
|
|
|
- If worldSpace WorldX+=tx Else Position+=Basis.i * tx
|
|
|
+ If localSpace LocalX+=tx Else Position+=Basis.i * tx
|
|
|
End
|
|
|
|
|
|
#rem monkeydoc Moves the entity on the Y axis.
|
|
@@ -361,9 +358,9 @@ Class Entity Extension
|
|
|
Moves the entity relative to its current orientation.
|
|
|
|
|
|
#end
|
|
|
- Method MoveY( ty:Float,worldSpace:Bool=False )
|
|
|
+ Method MoveY( ty:Float,localSpace:Bool=False )
|
|
|
|
|
|
- If worldSpace WorldY+=ty Else Position+=Basis.j * ty
|
|
|
+ If localSpace LocalY+=ty Else Position+=Basis.j * ty
|
|
|
End
|
|
|
|
|
|
#rem monkeydoc Moves the entity on the Z axis.
|
|
@@ -371,75 +368,75 @@ Class Entity Extension
|
|
|
Moves the entity relative to its current orientation.
|
|
|
|
|
|
#end
|
|
|
- Method MoveZ( tz:Float,worldSpace:Bool=False )
|
|
|
+ Method MoveZ( tz:Float,localSpace:Bool=False )
|
|
|
|
|
|
- If worldSpace WorldZ+=tz Else Position+=Basis.k * tz
|
|
|
+ If localSpace LocalZ+=tz Else Position+=Basis.k * tz
|
|
|
End
|
|
|
|
|
|
#rem monkeydoc Rotates the entity.
|
|
|
|
|
|
Rotates the entity.
|
|
|
|
|
|
- If `postRotate` is true, the rotation is applied after the entity's world rotation.
|
|
|
+ If `localSpace` is false, the rotation is applied after the entity's world rotation.
|
|
|
|
|
|
- If `postRotate` is false, the rotation is applied before the entity's local rotation.
|
|
|
+ If `localSpace` is true, the rotation is applied before the entity's local rotation.
|
|
|
|
|
|
#end
|
|
|
- Method Rotate( rv:Vec3f,postRotate:Bool=False )
|
|
|
+ Method Rotate( rv:Vec3f,localSpace:Bool=False )
|
|
|
|
|
|
Local basis:=Mat3f.Rotation( rv * DegreesToRadians )
|
|
|
|
|
|
- If postRotate WorldBasis=basis*WorldBasis Else Basis*=basis
|
|
|
+ If localSpace LocalBasis*=basis Else Basis=basis*Basis
|
|
|
End
|
|
|
|
|
|
- Method Rotate( rx:Float,ry:Float,rz:Float,postRotate:Bool=False )
|
|
|
+ Method Rotate( rx:Float,ry:Float,rz:Float,localSpace:Bool=False )
|
|
|
|
|
|
- Rotate( New Vec3f( rx,ry,rz ),postRotate )
|
|
|
+ Rotate( New Vec3f( rx,ry,rz ),localSpace )
|
|
|
End
|
|
|
|
|
|
#rem monkeydoc Rotates the entity around the X axis.
|
|
|
#end
|
|
|
- Method RotateX( rx:Float,postRotate:Bool=False )
|
|
|
+ Method RotateX( rx:Float,localSpace:Bool=False )
|
|
|
|
|
|
Local basis:=Mat3f.Pitch( rx * DegreesToRadians )
|
|
|
|
|
|
- If postRotate WorldBasis=basis*WorldBasis Else Basis*=basis
|
|
|
+ If localSpace LocalBasis=basis*LocalBasis Else Basis*=basis
|
|
|
End
|
|
|
|
|
|
#rem monkeydoc Rotates the entity around the Y axis.
|
|
|
#end
|
|
|
- Method RotateY( ry:Float,postRotate:Bool=False )
|
|
|
+ Method RotateY( ry:Float,localSpace:Bool=False )
|
|
|
|
|
|
Local basis:=Mat3f.Yaw( ry * DegreesToRadians )
|
|
|
|
|
|
- If postRotate WorldBasis=basis*WorldBasis Else Basis*=basis
|
|
|
+ If localSpace LocalBasis=basis*LocalBasis Else Basis*=basis
|
|
|
End
|
|
|
|
|
|
#rem monkeydoc Rotates the entity around the Z axis.
|
|
|
#end
|
|
|
- Method RotateZ( rz:Float,postRotate:Bool=False )
|
|
|
+ Method RotateZ( rz:Float,localSpace:Bool=False )
|
|
|
|
|
|
Local basis:=Mat3f.Roll( rz * DegreesToRadians )
|
|
|
|
|
|
- If postRotate WorldBasis=basis*WorldBasis Else Basis*=basis
|
|
|
+ If localSpace LocalBasis=basis*LocalBasis Else Basis*=basis
|
|
|
End
|
|
|
|
|
|
#rem monkeydoc Points the entity at a target.
|
|
|
#end
|
|
|
Method PointAt( target:Vec3f,up:Vec3f=New Vec3f( 0,1,0 ) )
|
|
|
|
|
|
- Local k:=(target-WorldPosition).Normalize()
|
|
|
+ Local k:=(target-LocalPosition).Normalize()
|
|
|
|
|
|
Local i:=up.Cross( k ).Normalize()
|
|
|
|
|
|
Local j:=k.Cross( i )
|
|
|
|
|
|
- WorldBasis=New Mat3f( i,j,k )
|
|
|
+ LocalBasis=New Mat3f( i,j,k )
|
|
|
End
|
|
|
|
|
|
Method PointAt( target:Entity,up:Vec3f=New Vec3f( 0,1,0 ) )
|
|
|
|
|
|
- PointAt( target.WorldPosition )
|
|
|
+ PointAt( target.LocalPosition )
|
|
|
End
|
|
|
-
|
|
|
+
|
|
|
End
|