#include <CscWorldElement.h>
|
| | CscWorldElement (const CscWorldElementId &id, const string &name, CscPoint3d *positionIn, CscPoint3d *rotationEulerIn, CscPhysicsType physicsType=CscPhysicsType::BOUNDING_BOX, float mass=5.0, vector< CscWorldElementPart * > *parts=nullptr, vector< CscPoint3d * > *positions=nullptr, vector< CscPoint3d * > *normals=nullptr, vector< CscPolygon * > *polygons=nullptr, vector< const CscLocationTag * > *locationTags=nullptr, float minX=0, float minY=0, float minZ=0, float depth=0, float height=0, float width=0) |
| |
| virtual | ~CscWorldElement () |
| |
| virtual CscPoint3d | getMinPositionInWorldCoordinates () const |
| |
| const CscPoint3d * | getPosition () const |
| |
| void | setPosition (float x, float y, float z) |
| |
| const CscPoint3d * | getRotationEulerAsPoint () const |
| |
| void | setRotationEuler (double x, double y, double z) |
| |
| void | setRotationQuaternion (double w, double x, double y, double z) |
| |
| bool | isIn3DArea (const CscArea3d *area) const |
| |
| const string & | getName () const |
| |
| virtual CscWorldElementId | getId () const |
| |
| float | getMass () |
| |
| virtual CscSize3d | getDimensions () const |
| |
| float * | getVerticesArray () const |
| |
| float * | getPolygonsArray () const |
| |
| int | getVerticesCount () const |
| |
| int | getPolygonsCount () const |
| |
| void | repositionateToZeroOriginPositions () |
| |
| void | repositionateToZeroOriginPolygons () |
| |
| vector< CscPoint3d * > * | getPositions () const |
| |
| vector< CscPolygon * > * | getPolygons () const |
| |
| vector< CscPolygon * > | getPolygonsInWorldCoordinates () const |
| |
| vector< CscPoint3d * > | getYPlanSlicePoints (double sliceY, double precisionCm=5.0) const |
| |
| vector< CscPoint3d * > * | getNormals () const |
| |
| const vector< CscWorldElementPart * > * | getParts () const |
| |
| vector< CscPoint3d * > * | getReconstructedVerticesFromPolygons (const int stepInCm=10) const |
| |
| CscPhysicsType | getPhysicsType () const |
| |
| const CscLocationTag * | getLocationTagByName (const string &name) const |
| |
| void | forcePolygons (const vector< CscPolygon * > &newPolygons) |
| |
| void | addTag (const string &tag) |
| |
| void | removeTag (const string &tag) |
| |
| bool | hasTag (const string &tag) const |
| |
| const double *const | getRotationQuaternionArray () const |
| |
| CscQuaternion | getRotationQuaternion () const |
| |
| CscRotation3dEuler | getRotationEuler () const |
| |
◆ CscWorldElement()
| CscWorldElement::CscWorldElement |
( |
const CscWorldElementId & |
id, |
|
|
const string & |
name, |
|
|
CscPoint3d * |
positionIn, |
|
|
CscPoint3d * |
rotationEulerIn, |
|
|
CscPhysicsType |
physicsType = CscPhysicsType::BOUNDING_BOX, |
|
|
float |
mass = 5.0, |
|
|
vector< CscWorldElementPart * > * |
parts = nullptr, |
|
|
vector< CscPoint3d * > * |
positions = nullptr, |
|
|
vector< CscPoint3d * > * |
normals = nullptr, |
|
|
vector< CscPolygon * > * |
polygons = nullptr, |
|
|
vector< const CscLocationTag * > * |
locationTags = nullptr, |
|
|
float |
minX = 0, |
|
|
float |
minY = 0, |
|
|
float |
minZ = 0, |
|
|
float |
depth = 0, |
|
|
float |
height = 0, |
|
|
float |
width = 0 |
|
) |
| |
◆ ~CscWorldElement()
| CscWorldElement::~CscWorldElement |
( |
| ) |
|
|
virtual |
◆ addTag()
| void CscWorldElement::addTag |
( |
const string & |
tag | ) |
|
◆ forcePolygons()
| void CscWorldElement::forcePolygons |
( |
const vector< CscPolygon * > & |
newPolygons | ) |
|
backward compatibility method which breaks encapsulation - PLEASE DO NOT USE NOTE: given vector will be copied
◆ getBaseRotation()
| const CscPoint3d & CscWorldElement::getBaseRotation |
( |
| ) |
const |
|
protectedvirtual |
◆ getDimensions()
| CscSize3d CscWorldElement::getDimensions |
( |
| ) |
const |
|
virtual |
Return this element's size in Conscience reference frame. This is the safe way to get element's initial dimensions. Before applying any rotation.
For instance for places: CSC depth => place.width => CSC X axis - size.x CSC width => place.height => CSC Z axis - size.z CSC height => place.depth => CSC Y axis - size.y
Reimplemented in CscWorldObject.
◆ getId()
◆ getLocationTagByName()
| const CscLocationTag * CscWorldElement::getLocationTagByName |
( |
const string & |
name | ) |
const |
searches for a location tag with given name and return it if exists, or nullptr if not
◆ getMass()
| float CscWorldElement::getMass |
( |
| ) |
|
◆ getMinPositionInWorldCoordinates()
| CscPoint3d CscWorldElement::getMinPositionInWorldCoordinates |
( |
| ) |
const |
|
virtual |
- Returns
- min position of this element in Conscience world's coordinates
Reimplemented in CscWorldPlace.
◆ getName()
| const string & CscWorldElement::getName |
( |
| ) |
const |
◆ getNormals()
| vector< CscPoint3d * > * CscWorldElement::getNormals |
( |
| ) |
const |
- Returns
- a pointer to a field. DO NOT DELETE
◆ getParts()
- Returns
- a pointer to a field. DO NOT DELETE
◆ getPhysicsType()
◆ getPolygons()
| vector< CscPolygon * > * CscWorldElement::getPolygons |
( |
| ) |
const |
- Returns
- a pointer to a field. DO NOT DELETE
◆ getPolygonsArray()
| float * CscWorldElement::getPolygonsArray |
( |
| ) |
const |
◆ getPolygonsCount()
| int CscWorldElement::getPolygonsCount |
( |
| ) |
const |
◆ getPolygonsInWorldCoordinates()
| vector< CscPolygon * > CscWorldElement::getPolygonsInWorldCoordinates |
( |
| ) |
const |
Converts polygon based on element's rotation and translate with position. This is the safe way to get current polygons for this element.
- Returns
- vector of NEW pointers. Should be DELETED.
◆ getPosition()
| const CscPoint3d * CscWorldElement::getPosition |
( |
| ) |
const |
◆ getPositions()
| vector< CscPoint3d * > * CscWorldElement::getPositions |
( |
| ) |
const |
- Returns
- a pointer to a field. DO NOT DELETE
◆ getReconstructedVerticesFromPolygons()
| vector< CscPoint3d * > * CscWorldElement::getReconstructedVerticesFromPolygons |
( |
const int |
stepInCm = 10 | ) |
const |
Generates vertices for this element based on polygons. Those points are not rotated and not shifted by element's position. It needs to be done manually
- Parameters
-
| stepInCm | wich resolution is required to build additionnal vertices in cm (defaulty 10cm) |
- Returns
- a NEW vector of NEW points. You HAVE TO DELETE points and vector after use
◆ getRotationEuler()
◆ getRotationEulerAsPoint()
| const CscPoint3d * CscWorldElement::getRotationEulerAsPoint |
( |
| ) |
const |
◆ getRotationQuaternion()
◆ getRotationQuaternionArray()
| const double *const CscWorldElement::getRotationQuaternionArray |
( |
| ) |
const |
- Returns
- 4 elements array: w,x,y,z
◆ getVerticesArray()
| float * CscWorldElement::getVerticesArray |
( |
| ) |
const |
◆ getVerticesCount()
| int CscWorldElement::getVerticesCount |
( |
| ) |
const |
◆ getYPlanSlicePoints()
| vector< CscPoint3d * > CscWorldElement::getYPlanSlicePoints |
( |
double |
sliceY, |
|
|
double |
precisionCm = 5.0 |
|
) |
| const |
Gets all points in world coordinates (i.e. with place rotation / position taken in account) computed using intersection with polygons at given Y height.
- Parameters
-
| sliceY | plan's Y in centimeters |
- Returns
- new points to be DELETED
◆ hasTag()
| bool CscWorldElement::hasTag |
( |
const string & |
tag | ) |
const |
◆ isIn3DArea()
| bool CscWorldElement::isIn3DArea |
( |
const CscArea3d * |
area | ) |
const |
◆ nextId()
generates an automatic unique ID based on a numeric value
◆ removeTag()
| void CscWorldElement::removeTag |
( |
const string & |
tag | ) |
|
◆ repositionateToZeroOriginPolygons()
| void CscWorldElement::repositionateToZeroOriginPolygons |
( |
| ) |
|
◆ repositionateToZeroOriginPositions()
| void CscWorldElement::repositionateToZeroOriginPositions |
( |
| ) |
|
◆ setPosition()
| void CscWorldElement::setPosition |
( |
float |
x, |
|
|
float |
y, |
|
|
float |
z |
|
) |
| |
x,y,z expected in centimeters
◆ setRotationEuler()
| void CscWorldElement::setRotationEuler |
( |
double |
x, |
|
|
double |
y, |
|
|
double |
z |
|
) |
| |
warning: not in sync with setRotationQuaternion
◆ setRotationQuaternion()
| void CscWorldElement::setRotationQuaternion |
( |
double |
w, |
|
|
double |
x, |
|
|
double |
y, |
|
|
double |
z |
|
) |
| |
warning: not in sync with setRotationEuler
◆ certitude
| float CscWorldElement::certitude = 0.0 |
◆ collideWithOthers
| bool CscWorldElement::collideWithOthers = true |
◆ dampingAngular
| float CscWorldElement::dampingAngular = 0.3 |
◆ dampingLinear
| float CscWorldElement::dampingLinear = 0.3 |
◆ depth
| float CscWorldElement::depth = 0 |
◆ friction
| float CscWorldElement::friction = 1.0 |
◆ height
| float CscWorldElement::height = 0 |
◆ id
◆ locationTags
◆ mass
| float CscWorldElement::mass = 1.0 |
◆ minX
| float CscWorldElement::minX |
◆ minY
| float CscWorldElement::minY |
◆ minZ
| float CscWorldElement::minZ |
◆ restitution
| float CscWorldElement::restitution = 0.3 |
◆ width
| float CscWorldElement::width = 0 |
The documentation for this class was generated from the following files: