Main Page | Alphabetical List | Compound List | File List | Compound Members | File Members

VEC3D.H File Reference

#include "basetype.h"

Go to the source code of this file.

Compounds

struct  geVec3d

Functions

GENESISAPI geFloat GENESISCC geVec3d_GetElement (geVec3d *V, int Index)
GENESISAPI void GENESISCC geVec3d_Set (geVec3d *V, geFloat X, geFloat Y, geFloat Z)
GENESISAPI void GENESISCC geVec3d_Get (const geVec3d *V, geFloat *X, geFloat *Y, geFloat *Z)
GENESISAPI geFloat GENESISCC geVec3d_DotProduct (const geVec3d *V1, const geVec3d *V2)
GENESISAPI void GENESISCC geVec3d_CrossProduct (const geVec3d *V1, const geVec3d *V2, geVec3d *VResult)
GENESISAPI geBoolean GENESISCC geVec3d_Compare (const geVec3d *V1, const geVec3d *V2, geFloat tolarance)
GENESISAPI geFloat GENESISCC geVec3d_Normalize (geVec3d *V1)
GENESISAPI geBoolean GENESISCC geVec3d_IsNormalized (const geVec3d *V)
GENESISAPI void GENESISCC geVec3d_Scale (const geVec3d *VSrc, geFloat Scale, geVec3d *VDst)
GENESISAPI geFloat GENESISCC geVec3d_Length (const geVec3d *V1)
GENESISAPI geFloat GENESISCC geVec3d_LengthSquared (const geVec3d *V1)
GENESISAPI void GENESISCC geVec3d_Subtract (const geVec3d *V1, const geVec3d *V2, geVec3d *V1MinusV2)
GENESISAPI void GENESISCC geVec3d_Add (const geVec3d *V1, const geVec3d *V2, geVec3d *VSum)
GENESISAPI void GENESISCC geVec3d_Copy (const geVec3d *Vsrc, geVec3d *Vdst)
GENESISAPI void GENESISCC geVec3d_Clear (geVec3d *V)
GENESISAPI void GENESISCC geVec3d_Inverse (geVec3d *V)
GENESISAPI void GENESISCC geVec3d_MA (geVec3d *V1, geFloat Scale, const geVec3d *V2, geVec3d *V1PlusV2Scaled)
GENESISAPI void GENESISCC geVec3d_AddScaled (const geVec3d *V1, const geVec3d *V2, geFloat Scale, geVec3d *V1PlusV2Scaled)
GENESISAPI geFloat GENESISCC geVec3d_DistanceBetween (const geVec3d *V1, const geVec3d *V2)
GENESISAPI geBoolean GENESISCC geVec3d_IsValid (const geVec3d *V)


Function Documentation

GENESISAPI void GENESISCC geVec3d_Add const geVec3d V1,
const geVec3d V2,
geVec3d VSum
 

Definition at line 229 of file VEC3D.C.

References GE_FALSE, GENESISAPI, GENESISCC, geVec3d_IsValid(), NULL, V1, V2, geVec3d::X, geVec3d::Y, and geVec3d::Z.

Referenced by _Electric_BoltEffectRender(), Bot_FindNewMoveVec(), Bot_ShootFoot(), Bot_Suicide(), Bot_TrackAction(), CheckVelocity(), CombineDLightWithRGBMapWithShadow(), Corona_Frame(), DrawBoundBox(), DynLight_Frame(), Electric_BoltEffectRender(), FireBlaster(), FireGrenade(), FireRocket(), FireShredder(), geActor_GetBoneExtBoxByIndex(), geActor_GetExtBox(), geActor_StretchBoundingBox(), geCamera_ScreenPointToWorld(), geExtBox_Translate(), gePhysicsObject_ApplyGlobalFrameForce(), gePhysicsObject_ApplyGlobalFrameImpulse(), gePhysicsObject_ComputeForces(), gePhysicsObject_GetLocation(), gePhysicsObject_GetLocationInEditorSpace(), gePhysicsObject_IncAppliedForce(), gePhysicsObject_IncAppliedTorque(), gePhysicsObject_IncForce(), gePhysicsObject_IncTorque(), gePhysicsObject_Integrate(), gePhysicsSystem_EnforceConstraints(), gePose_JointRelativeToParent(), geSprite_GetExtBox(), geSprite_UpdatePosition(), geWorld_SetModelXForm(), geXForm3d_Mirror(), Light_SetupLights(), PathPt_Frame(), PhysicsObject_Control(), Plat_Trigger(), RenderSubModels(), RenderWorldModel(), Shredder_Control(), Trace_CollideBeam(), Trace_GetContents(), Trace_GetTexureName(), Trace_MiscCollision(), Trace_ModelCollisionBBox(), Trace_TestModelMove(), Trace_WorldCollisionBBox(), Trace_WorldCollisionExact(), Trace_WorldCollisionExact2(), and Vec3d_RotateY().

00230 {
00231         assert( geVec3d_IsValid(V1) != GE_FALSE );
00232         assert( geVec3d_IsValid(V2) != GE_FALSE );
00233         assert ( V1PlusV2 != NULL );
00234         
00235         V1PlusV2->X = V1->X + V2->X;
00236         V1PlusV2->Y = V1->Y + V2->Y;
00237         V1PlusV2->Z = V1->Z + V2->Z;
00238 }

GENESISAPI void GENESISCC geVec3d_AddScaled const geVec3d V1,
const geVec3d V2,
geFloat  Scale,
geVec3d V1PlusV2Scaled
 

Definition at line 251 of file VEC3D.C.

References GE_FALSE, GENESISAPI, GENESISCC, geVec3d_IsValid(), NULL, V1, V2, geVec3d::X, geVec3d::Y, and geVec3d::Z.

Referenced by Attacker_ControlTurret(), Blaster_Control(), Bot_CheckVelocity(), Bot_Jump(), Bot_MoveFree(), Bot_MoveToPoint(), Bot_OverLedgeScan(), Bot_Physics(), Bot_ScanCheckVelocity(), Bot_ScanPhysics(), Bot_WeaponJump(), CheckVelocity(), ControlShredderFx(), DammagePlayer(), Electric_Frame(), FireBlaster(), FireRocket(), FireShredder(), Frustum_RotateToWorldSpace(), Frustum_TransformToWorldSpace(), geVKFrame_HermiteInterpolation(), geXForm3d_Mirror(), Grenade_Control(), Light_FogVerts(), MovePlayerUpStep(), PlayerPhysics(), Rocket_Control(), SendPlayersToClients(), and Trace_ActorCollide().

00252 {
00253         assert( geVec3d_IsValid(V1) != GE_FALSE );
00254         assert( geVec3d_IsValid(V2) != GE_FALSE );
00255         assert ( V1PlusV2Scaled != NULL );
00256         
00257         V1PlusV2Scaled->X = V1->X + V2->X*Scale;
00258         V1PlusV2Scaled->Y = V1->Y + V2->Y*Scale;
00259         V1PlusV2Scaled->Z = V1->Z + V2->Z*Scale;
00260 }

GENESISAPI void GENESISCC geVec3d_Clear geVec3d V  ) 
 

Definition at line 270 of file VEC3D.C.

References GENESISAPI, GENESISCC, NULL, and V.

Referenced by Bot_ActorDying(), Bot_CheckVelocity(), Bot_Dying(), Bot_InitShootPoint(), Bot_InitWaitForEntityDist(), Bot_InitWaitForEntityVisible(), Bot_InitWaitForPlayer(), Bot_ModeThinkLedge(), Bot_Physics(), Bot_ScanCheckVelocity(), Bot_TrackAction(), CheckVelocity(), Frustum_RotateToWorldSpace(), Frustum_TransformToWorldSpace(), geActor_Create(), geMotion_SampleChannels(), geMotion_SampleChannelsNamed(), gePhysicsObject_ClearAppliedForce(), gePhysicsObject_ClearAppliedTorque(), gePhysicsObject_ClearForce(), gePhysicsObject_ClearTorque(), gePhysicsObject_ComputeForces(), gePhysicsObject_Create(), geSprite_Create(), GetSurfInfo(), geVKFrame_HermiteRecompute(), and geXForm3d_SetFromLeftUpIn().

00271 {
00272         assert ( V != NULL );
00273         
00274         V->X = 0.0f;
00275         V->Y = 0.0f;
00276         V->Z = 0.0f;
00277 }

GENESISAPI geBoolean GENESISCC geVec3d_Compare const geVec3d V1,
const geVec3d V2,
geFloat  tolarance
 

Definition at line 107 of file VEC3D.C.

References GE_FALSE, GE_TRUE, geBoolean, GENESISAPI, GENESISCC, geVec3d_IsValid(), NULL, V1, and V2.

Referenced by BuildSkyBox(), CheckClientPlayerChanges(), Frustum_SetFromPoly(), geBody_AddNormal(), geBody_XSkinVertexCompare(), gePuppet_DrawShadow(), geQKFrame_PathIsHinged(), GetPlayerSendFlags(), geXForm3d_IsOrthogonal(), geXForm3d_IsOrthonormal(), ParseClientMove(), and XFormFromVector().

00108 {
00109         assert ( V1 != NULL );
00110         assert ( V2 != NULL );
00111         assert ( Tolerance >= 0.0 );
00112         assert( geVec3d_IsValid(V1) != GE_FALSE );
00113         assert( geVec3d_IsValid(V2) != GE_FALSE );
00114 
00115         if (fabs(V2->X - V1->X) > Tolerance) //VCOMPARE_EPSILON)
00116                 return GE_FALSE;
00117         if (fabs(V2->Y - V1->Y) > Tolerance) //VCOMPARE_EPSILON)
00118                 return GE_FALSE;
00119         if (fabs(V2->Z - V1->Z) > Tolerance) //VCOMPARE_EPSILON)
00120                 return GE_FALSE;
00121 
00122         return GE_TRUE;
00123 }

GENESISAPI void GENESISCC geVec3d_Copy const geVec3d Vsrc,
geVec3d Vdst
 

Definition at line 262 of file VEC3D.C.

References GE_FALSE, GENESISAPI, GENESISCC, geVec3d_IsValid(), and NULL.

Referenced by Bot_CheckVelocity(), Bot_NudgePlayer(), Bot_ScanCheckVelocity(), CheckVelocity(), CombineDLightWithRGBMap(), CombineDLightWithRGBMapWithShadow(), geActor_GetNonWorldExtBox(), geActor_GetPosition(), geCamera_ScreenPointToWorld(), gePhysicsJoint_Create(), gePhysicsJoint_GetLocationA(), gePhysicsJoint_GetLocationAInWorldSpace(), gePhysicsJoint_GetLocationB(), gePhysicsJoint_GetLocationBInWorldSpace(), gePhysicsJoint_SetLocationA(), gePhysicsJoint_SetLocationAInWorldSpace(), gePhysicsJoint_SetLocationB(), gePhysicsJoint_SetLocationBInWorldSpace(), gePhysicsObject_Create(), gePhysicsObject_GetAngularVelocity(), gePhysicsObject_GetAppliedForce(), gePhysicsObject_GetAppliedTorque(), gePhysicsObject_GetForce(), gePhysicsObject_GetLinearVelocity(), gePhysicsObject_GetOriginalLocation(), gePhysicsObject_GetTorque(), gePhysicsObject_SetAngularVelocity(), gePhysicsObject_SetAppliedForce(), gePhysicsObject_SetAppliedTorque(), gePhysicsObject_SetForce(), gePhysicsObject_SetLinearVelocity(), gePhysicsObject_SetOriginalLocation(), gePhysicsObject_SetTorque(), geVKFrame_HermiteRecompute(), and Trace_ModelCollision().

00263 {
00264         assert ( VDst != NULL );
00265         assert( geVec3d_IsValid(VSrc) != GE_FALSE );
00266         
00267         *VDst = *VSrc;
00268 }

GENESISAPI void GENESISCC geVec3d_CrossProduct const geVec3d V1,
const geVec3d V2,
geVec3d VResult
 

Definition at line 91 of file VEC3D.C.

References GE_FALSE, GENESISAPI, GENESISCC, geVec3d_IsValid(), NULL, V1, V2, geVec3d::X, geVec3d::Y, and geVec3d::Z.

Referenced by _Electric_BoltEffectRender(), Bot_CheckVelocity(), Bot_ScanCheckVelocity(), Bot_SetupShootXForm(), Bot_SetupXForm(), BumpMap_ComputePalette(), CalcSurfVectors(), CheckVelocity(), Client_UpdateSinglePlayer(), DrawLine3d(), Electric_BoltEffectRender(), Frustum_SetFromPoly(), gePhysicsObject_ApplyGlobalFrameForce(), gePhysicsObject_ApplyGlobalFrameImpulse(), gePhysicsObject_Integrate(), gePhysicsSystem_EnforceConstraints(), gePlane_SetFromVerts(), gePuppet_DrawShadow(), gePuppet_RenderThroughFrustum(), geXForm3d_IsOrthogonal(), geXForm3d_IsOrthonormal(), geXForm3d_Orthonormalize(), Particles_MoveParticles(), and XFormFromVector().

00092 {
00093         geVec3d Result;
00094         assert ( V1 != NULL );
00095         assert ( V2 != NULL );
00096         assert ( VResult != NULL );
00097         assert( geVec3d_IsValid(V1) != GE_FALSE );
00098         assert( geVec3d_IsValid(V2) != GE_FALSE );
00099 
00100         Result.X = V1->Y*V2->Z - V1->Z*V2->Y;
00101     Result.Y = V1->Z*V2->X - V1->X*V2->Z;
00102     Result.Z = V1->X*V2->Y - V1->Y*V2->X;
00103 
00104         *VResult = Result;
00105 }

GENESISAPI geFloat GENESISCC geVec3d_DistanceBetween const geVec3d V1,
const geVec3d V2
 

Definition at line 288 of file VEC3D.C.

References B, GE_FALSE, geFloat, GENESISAPI, GENESISCC, geVec3d_IsValid(), geVec3d_Length(), geVec3d_Subtract(), V1, and V2.

Referenced by Bot_FindItem(), Bot_FindNewMoveVec(), Bot_FindRandomItem(), Bot_GetRangeIndex(), Bot_LeaveTrack(), Bot_ModeThinkAttack(), Bot_MoveFree(), Bot_MoveToPoint(), Bot_WaitForEntityDist(), DistWeightedY(), Trace_ModelCollision(), Track_FindCloseTrack(), Track_FindFarTrack(), Track_FindTrack(), Track_Length(), Track_LinkTest(), and Track_NextMultiTrack().

00289 {
00290         geVec3d B;
00291         
00292         assert( geVec3d_IsValid(V1) != GE_FALSE );
00293         assert( geVec3d_IsValid(V2) != GE_FALSE );
00294 
00295         geVec3d_Subtract(V1,V2,&B);
00296         return geVec3d_Length(&B);
00297 }

GENESISAPI geFloat GENESISCC geVec3d_DotProduct const geVec3d V1,
const geVec3d V2
 

Definition at line 81 of file VEC3D.C.

References GE_FALSE, geFloat, GENESISAPI, GENESISCC, geVec3d_IsValid(), NULL, V1, and V2.

Referenced by Bot_CheckVelocity(), Bot_PastPoint(), Bot_ScanCheckVelocity(), Bot_SetupShootXForm(), BumpMap_ComputePalette(), CalcGradients(), CalcSurfVectors(), CheckVelocity(), CombineDLightWithRGBMap(), CombineDLightWithRGBMapWithShadow(), FogLightmap1(), FogLightmap2(), Frustum_PointInFrustum(), Frustum_PointsInFrustum(), Frustum_RotateToWorldSpace(), Frustum_TransformToWorldSpace(), gePlane_ClipVertsFanned(), gePlane_ClipVertsFannedUVRGB(), gePlane_SetFromVerts(), gePuppet_RenderThroughFrustum(), geSprite_CreateFrustumClippedScreenPoly(), geSprite_UpdateLighting(), geSprite_UpdateVertexesToFaceCamera(), GetTexVerts(), geVec3d_Length(), geVec3d_LengthSquared(), geVec3d_Normalize(), geXForm3d_Mirror(), IntersectLeafSides2(), Light_FogVerts(), Light_GetLightmapRGB(), Light_GetLightmapRGBBlended(), Particles_MoveParticles(), PhysicsObject_Trigger(), Plane_FaceDistanceFast(), Plane_PlaneDistance(), Plane_PlaneDistanceFast(), ReflectVelocity(), RenderBSPFrontBack_r(), Trace_ActorCollide(), Trace_BoxOnPlaneSide(), Trace_MiscCollision(), Trace_ModelCollisionBBox(), Trace_TestModelMove(), Trace_WorldCollisionBBox(), and Trace_WorldCollisionExact().

00082 {
00083         assert ( V1 != NULL );
00084         assert ( V2 != NULL );
00085         assert( geVec3d_IsValid(V1) != GE_FALSE );
00086         assert( geVec3d_IsValid(V2) != GE_FALSE );
00087         
00088         return(V1->X*V2->X + V1->Y*V2->Y + V1->Z*V2->Z);
00089 }

GENESISAPI void GENESISCC geVec3d_Get const geVec3d V,
geFloat X,
geFloat Y,
geFloat Z
 

Definition at line 67 of file VEC3D.C.

References GE_FALSE, GENESISAPI, GENESISCC, geVec3d_IsValid(), NULL, V, and Z.

00068 {
00069         assert ( V != NULL );
00070         assert ( X != NULL );
00071         assert ( Y != NULL );
00072         assert ( Z != NULL );
00073         assert( geVec3d_IsValid(V) != GE_FALSE );
00074         
00075         *X = V->X;
00076         *Y = V->Y;
00077         *Z = V->Z;
00078 }

GENESISAPI geFloat GENESISCC geVec3d_GetElement geVec3d V,
int  Index
 

Definition at line 35 of file VEC3D.C.

References geFloat, GENESISAPI, GENESISCC, NULL, and V.

Referenced by Trace_ActorCollide(), and Trace_GetContents().

00036 {
00037         assert( V != NULL );
00038         assert( Index >= 0 );
00039         assert( Index <  3 );
00040         return (* ((&((V)->X)) +  (Index) ));
00041 }

GENESISAPI void GENESISCC geVec3d_Inverse geVec3d V  ) 
 

Definition at line 279 of file VEC3D.C.

References GE_FALSE, GENESISAPI, GENESISCC, geVec3d_IsValid(), and V.

Referenced by CalcSurfVectors(), geCamera_ConvertWorldSpaceToCameraSpace(), geWorld_SetModelXForm(), geXForm3d_IsOrthogonal(), geXForm3d_IsOrthonormal(), IntersectLeafSides2(), IntersectLeafSides_r(), PointInLeafSides(), RenderFace(), and Trace_WorldCollisionExact().

00280 {
00281         assert( geVec3d_IsValid(V) != GE_FALSE );
00282         
00283         V->X = -V->X;
00284         V->Y = -V->Y;
00285         V->Z = -V->Z;
00286 }

GENESISAPI geBoolean GENESISCC geVec3d_IsNormalized const geVec3d V  ) 
 

Definition at line 182 of file VEC3D.C.

References GE_FALSE, GE_TRUE, geBoolean, geFloat, GENESISAPI, GENESISCC, geVec3d_IsValid(), geVec3d_Length(), V, and VCOMPARE_EPSILON.

Referenced by gePuppet_SetLightingOptions(), and geXForm3d_SetFromLeftUpIn().

00183 {
00184         geFloat length;
00185 
00186         assert( geVec3d_IsValid(V) != GE_FALSE );
00187 
00188         length = geVec3d_Length(V);
00189         if      ((length >= 1.0f - VCOMPARE_EPSILON) && (length <= 1.0f + VCOMPARE_EPSILON))
00190                 return GE_TRUE;
00191 
00192         return GE_FALSE;
00193 }

GENESISAPI geBoolean GENESISCC geVec3d_IsValid const geVec3d V  ) 
 

Definition at line 44 of file VEC3D.C.

References GE_FALSE, GE_TRUE, geBoolean, GENESISAPI, GENESISCC, NULL, and V.

Referenced by geActor_AccumulateMinMax(), geActor_GetBoneBoundingBoxByIndex(), geExtBox_ContainsPoint(), geExtBox_ExtendToEnclose(), geExtBox_IsValid(), geExtBox_LinearSweep(), geExtBox_RayCollision(), geExtBox_Set(), geExtBox_SetScaling(), geExtBox_SetToPoint(), geExtBox_SetTranslation(), geExtBox_Translate(), gePose_SetScale(), geQuaternion_GetAxisAngle(), geQuaternion_Rotate(), geQuaternion_SetFromAxisAngle(), geQuaternion_SetVec3d(), geSprite_SetLightingOptions(), geVec3d_Add(), geVec3d_AddScaled(), geVec3d_Compare(), geVec3d_Copy(), geVec3d_CrossProduct(), geVec3d_DistanceBetween(), geVec3d_DotProduct(), geVec3d_Get(), geVec3d_Inverse(), geVec3d_IsNormalized(), geVec3d_Length(), geVec3d_MA(), geVec3d_Normalize(), geVec3d_Scale(), geVec3d_Set(), geVec3d_Subtract(), geXForm3d_GetEulerAngles(), geXForm3d_GetIn(), geXForm3d_GetLeft(), geXForm3d_GetUp(), geXForm3d_IsOrthogonal(), geXForm3d_IsOrthonormal(), geXForm3d_IsValid(), geXForm3d_Rotate(), geXForm3d_SetEulerAngles(), geXForm3d_SetTranslation(), geXForm3d_Transform(), geXForm3d_TransposeTransform(), Particles_EmitSources(), and Particles_MoveParticles().

00045 {
00046         if (V == NULL)
00047                 return GE_FALSE;
00048         if ((V->X * V->X) < 0.0f) 
00049                 return GE_FALSE;
00050         if ((V->Y * V->Y) < 0.0f) 
00051                 return GE_FALSE;
00052         if ((V->Z * V->Z) < 0.0f) 
00053                 return GE_FALSE;
00054         return GE_TRUE;
00055 }

GENESISAPI geFloat GENESISCC geVec3d_Length const geVec3d V1  ) 
 

Definition at line 211 of file VEC3D.C.

References GE_FALSE, geFloat, GENESISAPI, GENESISCC, geVec3d_DotProduct(), geVec3d_IsValid(), and V1.

Referenced by Bot_Animate(), Bot_FindNewMoveVec(), Bot_OverLedgeScan(), Bot_PastPoint(), Bot_Physics(), Bot_PickTgtPlayer(), Bot_SetupShootXForm(), Bot_SetupXForm(), CalcSurfVectors(), CheckVelocity(), Client_Control(), Corona_Frame(), gePuppet_RenderThroughFrustum(), geQuaternion_SetFromAxisAngle(), geSound3D_GetConfig(), geSound3D_GetConfigIgnoreObstructions(), GetSurfInfo(), geVec3d_DistanceBetween(), geVec3d_IsNormalized(), Grenade_Control(), IntersectLeafSides_r(), Light_FogVerts(), ParseClientMove(), PathPoint_Frame2(), PhysicsObject_Control(), PlayerPhysics(), Server_GetNextPlayerInRadius(), Trace_WorldCollisionBBox(), and Trace_WorldCollisionExact().

00212 {       
00213         assert( geVec3d_IsValid(V1) != GE_FALSE );
00214 
00215         return (geFloat)sqrt(geVec3d_DotProduct(V1, V1));
00216 }

GENESISAPI geFloat GENESISCC geVec3d_LengthSquared const geVec3d V1  ) 
 

Definition at line 206 of file VEC3D.C.

References geFloat, GENESISAPI, GENESISCC, geVec3d_DotProduct(), and V1.

Referenced by Particles_MoveParticles().

00207 {       
00208         return geVec3d_DotProduct(V1, V1);
00209 }

GENESISAPI void GENESISCC geVec3d_MA geVec3d V1,
geFloat  Scale,
const geVec3d V2,
geVec3d V1PlusV2Scaled
 

Definition at line 240 of file VEC3D.C.

References GE_FALSE, GENESISAPI, GENESISCC, geVec3d_IsValid(), NULL, V1, V2, geVec3d::X, geVec3d::Y, and geVec3d::Z.

Referenced by CalcSurfVectors(), Client_Control(), Trace_ModelCollisionBBox(), and Trace_TestModelMove().

00241 {
00242         assert( geVec3d_IsValid(V1) != GE_FALSE );
00243         assert( geVec3d_IsValid(V2) != GE_FALSE );
00244         assert ( V1PlusV2Scaled != NULL );
00245         
00246         V1PlusV2Scaled->X = V1->X + V2->X*Scale;
00247         V1PlusV2Scaled->Y = V1->Y + V2->Y*Scale;
00248         V1PlusV2Scaled->Z = V1->Z + V2->Z*Scale;
00249 }

GENESISAPI geFloat GENESISCC geVec3d_Normalize geVec3d V1  ) 
 

Definition at line 161 of file VEC3D.C.

References GE_FALSE, geFloat, GENESISAPI, GENESISCC, geVec3d_DotProduct(), geVec3d_IsValid(), and V1.

Referenced by _Electric_BoltEffectRender(), Ang2Vec(), Attacker_ControlTurret(), Bot_FindNewMoveVec(), Bot_InitMoveFree(), Bot_InitMoveToPoint(), Bot_MoveToPoint(), Bot_OverLedgeScan(), Bot_PastPoint(), Bot_SetupShootXForm(), Bot_SetupXForm(), BumpMap_ComputePalette(), CalcSurfVectors(), CheckVelocity(), Client_UpdateSinglePlayer(), DammagePlayer(), DoSplashScreen(), DrawLine3d(), Electric_BoltEffectRender(), FogLightmap1(), FogLightmap2(), Frustum_SetFromCamera(), Frustum_SetFromPoly(), geBody_AddNormal(), geCamera_ScreenPointToWorld(), gePlane_SetFromVerts(), gePuppet_Create(), gePuppet_DrawShadow(), gePuppet_RenderThroughFrustum(), geQKFrame_WriteToBinaryFile(), geQKFrame_WriteToFile(), geSprite_CreateFrustumClippedScreenPoly(), geSprite_UpdateVertexesToFaceCamera(), geXForm3d_IsOrthogonal(), geXForm3d_Mirror(), geXForm3d_Orthonormalize(), Light_FogVerts(), Particles_Create(), PhysicsObject_Control(), Trace_ActorCollide(), and XFormFromVector().

00162 {
00163         geFloat OneOverDist;
00164         geFloat Dist;
00165 
00166         assert( geVec3d_IsValid(V1) != GE_FALSE );
00167 
00168         Dist = (geFloat)sqrt(geVec3d_DotProduct(V1, V1));
00169 
00170         if (Dist == 0.0)
00171                 return 0.0f;
00172         OneOverDist = 1.0f/Dist;
00173         
00174         V1->X *= OneOverDist;
00175         V1->Y *= OneOverDist;
00176         V1->Z *= OneOverDist;
00177 
00178         return Dist;
00179 }

GENESISAPI void GENESISCC geVec3d_Scale const geVec3d VSrc,
geFloat  Scale,
geVec3d VDst
 

Definition at line 195 of file VEC3D.C.

References GE_FALSE, GENESISAPI, GENESISCC, geVec3d_IsValid(), NULL, geVec3d::X, geVec3d::Y, and geVec3d::Z.

Referenced by _Electric_BoltEffectRender(), Blaster_Control(), Bot_CheckVelocity(), Bot_FindNewMoveVec(), Bot_MoveScan(), Bot_Physics(), Bot_ScanCheckVelocity(), Bot_ShootFoot(), Bot_Suicide(), Bot_TrackAction(), CalcGradients(), CalcSurfVectors(), CheckVelocity(), DrawLine3d(), Electric_BoltEffectRender(), FireGrenade(), FireShredder(), geCamera_ScreenPointToWorld(), gePhysicsJoint_Create(), gePhysicsObject_ApplyGlobalFrameImpulse(), gePhysicsObject_ComputeForces(), gePhysicsObject_Create(), gePhysicsObject_GetLocationInEditorSpace(), gePhysicsObject_GetXFormInEditorSpace(), gePhysicsObject_Integrate(), gePhysicsSystem_EnforceConstraints(), gePuppet_DrawShadow(), geSprite_UpdateLighting(), geVKFrame_HermiteInterpolation(), geVKFrame_HermiteRecompute(), geWorld_SetModelXForm(), PhysicsObject_Control(), PhysicsObject_Trigger(), PlayerPhysics(), RenderTexturedPoint(), Rocket_Control(), and Trace_CollideBeam().

00196 {
00197         assert ( VDst != NULL );
00198         assert( geVec3d_IsValid(VSrc) != GE_FALSE );
00199 
00200         VDst->X = VSrc->X * Scale;
00201         VDst->Y = VSrc->Y * Scale;
00202         VDst->Z = VSrc->Z * Scale;
00203         assert( geVec3d_IsValid(VDst) != GE_FALSE );
00204 }

GENESISAPI void GENESISCC geVec3d_Set geVec3d V,
geFloat  X,
geFloat  Y,
geFloat  Z
 

Definition at line 58 of file VEC3D.C.

References GE_FALSE, GENESISAPI, GENESISCC, geVec3d_IsValid(), NULL, V, and Z.

Referenced by Attacker_TurretSpawn(), BuildSkyBox(), Client_UpdateSinglePlayer(), DoSplashScreen(), FireBlaster(), FireGrenade(), FireRocket(), FireShredder(), geActor_GetDynamicExtBox(), geActor_SetScale(), geBody_AddBone(), geBody_CreateNull(), geBodyInst_GetGeometry(), geExtBox_GetTranslation(), geExtBox_RayCollision(), geExtBox_Translate(), gePhysicsObject_ComputeForces(), gePhysicsObject_Create(), gePose_Clear(), gePose_InitializeJoint(), gePuppet_Render(), geWorld_IsActorPotentiallyVisible(), geXForm3d_Mirror(), and Item_RocketAmmoSpawn().

00059 {
00060         assert ( V != NULL );
00061         V->X = X;
00062         V->Y = Y;
00063         V->Z = Z;
00064         assert( geVec3d_IsValid(V) != GE_FALSE );
00065 }

GENESISAPI void GENESISCC geVec3d_Subtract const geVec3d V1,
const geVec3d V2,
geVec3d V1MinusV2
 

Definition at line 218 of file VEC3D.C.

References GE_FALSE, GENESISAPI, GENESISCC, geVec3d_IsValid(), NULL, V1, V2, geVec3d::X, geVec3d::Y, and geVec3d::Z.

Referenced by _Electric_BoltEffectRender(), Attacker_ControlTurret(), Bot_FindNewMoveVec(), Bot_InitMoveFree(), Bot_InitMoveToPoint(), Bot_MoveFree(), Bot_MoveToPoint(), Bot_OverLedgeScan(), Bot_PastPoint(), Bot_PickTgtPlayer(), Bot_Reposition(), Bot_Shoot(), Bot_ShootPoint(), Bot_TrackAction(), Bot_WaitForEntityVisible(), BumpMap_ComputePalette(), CalcSurfVectors(), CheckVelocity(), Corona_Frame(), DammagePlayer(), DrawLine3d(), DynLight_Frame(), Electric_BoltEffectRender(), Electric_Frame(), FogLightmap1(), FogLightmap2(), Frustum_SetFromPoly(), geActor_GetBoneBoundingBoxByIndex(), geActor_GetBoneExtBoxByIndex(), geActor_StretchBoundingBox(), geBox_DetectCollisionBetween(), geExtBox_GetScaling(), geExtBox_RayCollision(), geExtBox_SetTranslation(), gePhysicsJoint_Create(), gePhysicsObject_Create(), gePhysicsObject_Integrate(), gePhysicsSystem_EnforceConstraints(), gePlane_SetFromVerts(), gePuppet_ComputeAmbientLight(), gePuppet_DrawShadow(), gePuppet_PrepLights(), gePuppet_RenderThroughFrustum(), geSound3D_GetConfig(), geSound3D_GetConfigIgnoreObstructions(), geSprite_CreateFrustumClippedScreenPoly(), geSprite_UpdateLighting(), geVec3d_DistanceBetween(), geVKFrame_HermiteRecompute(), geXForm3d_Mirror(), Grenade_Control(), IntersectLeafSides_r(), Light_FogVerts(), Light_SetupLights(), ParseClientMove(), Particles_MoveParticles(), PathPt_Frame(), PhysicsObject_Control(), PhysicsObject_Trigger(), RenderSubModels(), RenderWorldModel(), Server_GetNextPlayerInRadius(), Trace_ActorCollide(), Trace_CollideBeam(), Trace_GetContents(), Trace_GetTexureName(), Trace_MiscCollision(), Trace_ModelCollision(), Trace_ModelCollisionBBox(), Trace_TestModelMove(), Trace_WorldCollisionBBox(), Trace_WorldCollisionExact(), Trace_WorldCollisionExact2(), Vec3d_RotateY(), and XFormFromVector().

00219 {
00220         assert( geVec3d_IsValid(V1) != GE_FALSE );
00221         assert( geVec3d_IsValid(V2) != GE_FALSE );
00222         assert ( V1MinusV2 != NULL );
00223 
00224         V1MinusV2->X = V1->X - V2->X;
00225         V1MinusV2->Y = V1->Y - V2->Y;
00226         V1MinusV2->Z = V1->Z - V2->Z;
00227 }


Generated on Tue Sep 30 12:38:21 2003 for GTestAndEngine by doxygen 1.3.2