pe_params_pos

#include

Inherits pe_params.

Public Types

enum entype { type_id = ePE_params_pos }

Public Attributes

Vec3 pos
quaternionf q
float scale
Note that since there's no per-entity scale, it gets 'baked' into individual parts' scales.
Matrix34 * pMtx3x4
Optional position+orientation.
Matrix33 * pMtx3x3
Optional orientation via 3x3 matrix.
int iSimClass
See the sim_class enum.
int bRecalcBounds
Tells to recompute the bounding boxes.
bool bEntGridUseOBB
Whether or not to use part OBBs rather than object AABB when registering in the entity grid.
const IPhysicalEntity * pGridRefEnt
New grid (set via a reference entity)

Detailed Description

Sets position and orientation of entity.

#include 

// Sets the position of a physical entity using the pe_params_pos structure
void SetPhysicalEntityPosition(IPhysicalEntity& physicalEntity)
{
    // The pe_params_pos structure is used to set position, orientation and scale
    pe_params_pos positionParams;
    // Move the entity to {50,50,50} in world coordinates
    positionParams.pos = Vec3(50, 50, 50);
    // Reset the entity orientation
    positionParams.q = IDENTITY;
    // Make sure we use default scaling (100%)
    positionParams.scale = 1.f;

    // IPhysicalEntity::SetParams may be queued if the physics thread is empty or there are other commands queued.
    // We can change isThreadSafe to 1 if we are operating on a physics thread to have to event processed immediately
    int isThreadSafe = 0;
    // Set the position on the entity
    physicalEntity.SetParams(&positionParams, isThreadSafe);
}