MCPcopy Create free account
hub / github.com/axmolengine/axmol / syncToNode

Method syncToNode

core/navmesh/NavMeshObstacle.cpp:120–136  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

118}
119
120void NavMeshObstacle::syncToNode()
121{
122 if (_tileCache)
123 {
124 auto obstacle = _tileCache->getObstacleByRef(_obstacleID);
125 if (obstacle && obstacle->type == DT_OBSTACLE_CYLINDER)
126 {
127 auto& cylinder = obstacle->cylinder;
128 Vec3 localPos = Vec3(cylinder.pos[0], cylinder.pos[1], cylinder.pos[2]);
129 if (_owner->getParent())
130 _owner->getParent()->getWorldToNodeTransform().transformPoint(localPos, &localPos);
131 _owner->setPosition3D(localPos);
132 _radius = cylinder.radius;
133 _height = cylinder.height;
134 }
135 }
136}
137
138void ax::NavMeshObstacle::setRadius(float radius)
139{

Callers

nothing calls this directly

Calls 5

getObstacleByRefMethod · 0.80
Vec3Function · 0.50
getParentMethod · 0.45
setPosition3DMethod · 0.45

Tested by

no test coverage detected