ZsVec2AngularVec

From SIMboxWiki

Jump to: navigation, search

Contents

Description

Use the function zsVec2AngularVec to convert from the 3D engine zsVec type to the simulation AngularVec type.

Syntax

static void zsVec2AngularVec(

const zsVec3& zsVec,
AngularVec& angVec
);

Parameters

zsVec

[in] The vector you want to convert.

angVec

[out] Returned converted vector.

Return Value

None.

Remarks

The 3D engine and the simulation engine represent vectors differently. For using 3D engine API you need to convert from simulation type to 3D engine type and then convert the results conversely.

Example

{

&ldots;

Location laserBeamLoc;

// get the laser beam location

GET_OTHER_ENTITY_ATT_BY_NAME(_parentId,"ATT_LASER_BEAM_LOCATION",laserBeamLoc);

// X,Y,Z,YAW,PITCH,ROLL

zsVec3 pos,ori,groundHit;

// convert to zeus coordinate

linearVec2zsVec(laserBeamLoc.linVec(),pos);

angularVec2zsVec(laserBeamLoc.angVec(),ori);

//get the point where the laser beam hit the ground

zsRET retVal = TriD::GetLookAtPoint(pos,ori,groundHit);

// check if we hit the ground

if (retVal == zsOK)

{

// convert from 3D engine type to simulation type

zsVec2LinearVec(groundHit,_position);

&ldots;

}

See Also

angularVec2zsVec

linearVec2zsVec

globalToLocal

Personal tools