#include <PointModel.h>


Public Types | |
| typedef Vec3Types | InDataTypes |
| typedef Vec3Types | DataTypes |
| typedef DataTypes::VecCoord | VecCoord |
| typedef DataTypes::VecDeriv | VecDeriv |
| typedef DataTypes::Coord | Coord |
| typedef DataTypes::Deriv | Deriv |
| typedef Point | Element |
Public Member Functions | |
| PointModel () | |
| virtual void | init () |
| Initialization method called at graph modification, during bottom-up traversal. | |
| virtual void | resize (int size) |
| Set the number of elements. | |
| virtual void | computeBoundingTree (int maxDepth=0) |
| Create or update the bounding volume hierarchy. | |
| virtual void | computeContinuousBoundingTree (double dt, int maxDepth=0) |
| Create or update the bounding volume hierarchy, accounting for motions within the given timestep. | |
| void | draw (int index) |
| Render an collision element. | |
| void | draw () |
| Render the whole collision model. | |
| virtual bool | canCollideWithElement (int index, CollisionModel *model2, int index2) |
| Test if two elements can collide with each other. | |
| core::componentmodel::behavior::MechanicalState < Vec3Types > * | getMechanicalState () |
Protected Member Functions | |
| void | updateNormals () |
Protected Attributes | |
| core::componentmodel::behavior::MechanicalState < Vec3Types > * | mstate |
| Data< bool > | computeNormals |
| VecDeriv | normals |
Friends | |
| class | Point |
Definition at line 62 of file PointModel.h.
Definition at line 69 of file PointModel.h.
Definition at line 66 of file PointModel.h.
Definition at line 70 of file PointModel.h.
Definition at line 71 of file PointModel.h.
Definition at line 65 of file PointModel.h.
Definition at line 67 of file PointModel.h.
Definition at line 68 of file PointModel.h.
| sofa::component::collision::PointModel::PointModel | ( | ) |
Definition at line 69 of file PointModel.cpp.
| bool sofa::component::collision::PointModel::canCollideWithElement | ( | int | , | |
| CollisionModel * | , | |||
| int | ||||
| ) | [virtual] |
Test if two elements can collide with each other.
This method should be implemented by models supporting self-collisions to prune tests between adjacent elements.
Default to true. Note that this method assumes that canCollideWith(model2) was already used to test if the collision models can collide.
Reimplemented from sofa::core::CollisionModel.
Definition at line 144 of file PointModel.cpp.
References sofa::core::CollisionModel::bSelfCollision, sofa::core::CollisionModel::canCollideWithElement(), sofa::core::objectmodel::BaseObject::getContext(), and sofa::core::objectmodel::Data< T >::getValue().
| void sofa::component::collision::PointModel::computeBoundingTree | ( | int | maxDepth = 0 |
) | [virtual] |
Create or update the bounding volume hierarchy.
Implements sofa::core::CollisionModel.
Reimplemented in sofa::component::collision::SpatialGridPointModel.
Definition at line 157 of file PointModel.cpp.
References sofa::component::collision::CubeModel::computeBoundingTree(), computeNormals, sofa::core::CollisionModel::empty(), sofa::core::objectmodel::Data< T >::getValue(), sofa::core::CollisionModel::isMoving(), mstate, sofa::component::collision::Point::p(), sofa::component::collision::CubeModel::resize(), resize(), sofa::component::collision::CubeModel::setParentOf(), sofa::core::CollisionModel::size, and updateNormals().
Referenced by SofaFlowVR::FlowVRInputMesh::flowvrBeginIteration().
| void sofa::component::collision::PointModel::computeContinuousBoundingTree | ( | double | , | |
| int | maxDepth = 0 | |||
| ) | [virtual] |
Create or update the bounding volume hierarchy, accounting for motions within the given timestep.
Default to computeBoundingTree().
Reimplemented from sofa::core::CollisionModel.
Definition at line 186 of file PointModel.cpp.
References sofa::component::collision::CubeModel::computeBoundingTree(), computeNormals, sofa::core::CollisionModel::empty(), sofa::core::objectmodel::Data< T >::getValue(), sofa::core::CollisionModel::isMoving(), mstate, sofa::component::collision::Point::p(), sofa::component::collision::CubeModel::resize(), resize(), sofa::component::collision::CubeModel::setParentOf(), sofa::core::CollisionModel::size, updateNormals(), and sofa::component::collision::Point::v().
| void sofa::component::collision::PointModel::draw | ( | ) | [virtual] |
Render the whole collision model.
Reimplemented from sofa::core::CollisionModel.
Definition at line 111 of file PointModel.cpp.
References sofa::core::CollisionModel::draw(), sofa::core::CollisionModel::getColor4f(), sofa::core::objectmodel::BaseObject::getContext(), sofa::core::CollisionModel::getPrevious(), mstate, resize(), and sofa::core::CollisionModel::size.
| void sofa::component::collision::PointModel::draw | ( | int | ) | [virtual] |
Render an collision element.
Reimplemented from sofa::core::CollisionModel.
Definition at line 96 of file PointModel.cpp.
References sofa::helper::gl::glVertexT(), normals, and sofa::component::collision::Point::p().
| core::componentmodel::behavior::MechanicalState<Vec3Types>* sofa::component::collision::PointModel::getMechanicalState | ( | ) | [inline] |
| void sofa::component::collision::PointModel::init | ( | void | ) | [virtual] |
Initialization method called at graph modification, during bottom-up traversal.
Reimplemented from sofa::core::objectmodel::BaseObject.
Reimplemented in sofa::component::collision::SpatialGridPointModel.
Definition at line 80 of file PointModel.cpp.
References computeNormals, sofa::core::objectmodel::BaseObject::getContext(), sofa::core::objectmodel::BaseContext::getMechanicalState(), sofa::core::objectmodel::Data< T >::getValue(), mstate, resize(), and updateNormals().
| void sofa::component::collision::PointModel::resize | ( | int | s | ) | [virtual] |
Set the number of elements.
Reimplemented from sofa::core::CollisionModel.
Definition at line 75 of file PointModel.cpp.
Referenced by sofa::component::collision::SpatialGridPointModel::computeBoundingTree(), computeBoundingTree(), computeContinuousBoundingTree(), draw(), and init().
| void sofa::component::collision::PointModel::updateNormals | ( | ) | [protected] |
Hexas
Definition at line 226 of file PointModel.cpp.
References cross(), sofa::core::objectmodel::BaseObject::getContext(), sofa::core::objectmodel::BaseContext::getMeshTopology(), sofa::core::componentmodel::topology::BaseMeshTopology::getNbHexas(), sofa::core::componentmodel::topology::BaseMeshTopology::getNbQuads(), sofa::core::componentmodel::topology::BaseMeshTopology::getNbTetras(), sofa::core::componentmodel::topology::BaseMeshTopology::getNbTriangles(), sofa::core::componentmodel::topology::BaseMeshTopology::getQuads(), sofa::core::componentmodel::topology::BaseMeshTopology::getTetras(), sofa::core::componentmodel::topology::BaseMeshTopology::getTriangles(), mstate, and normals.
Referenced by computeBoundingTree(), computeContinuousBoundingTree(), and init().
friend class Point [friend] |
Definition at line 72 of file PointModel.h.
Definition at line 102 of file PointModel.h.
Referenced by computeBoundingTree(), computeContinuousBoundingTree(), and init().
core::componentmodel::behavior::MechanicalState<Vec3Types>* sofa::component::collision::PointModel::mstate [protected] |
Definition at line 100 of file PointModel.h.
Referenced by sofa::component::collision::SpatialGridPointModel::computeBoundingTree(), computeBoundingTree(), computeContinuousBoundingTree(), draw(), getMechanicalState(), init(), and updateNormals().
1.5.7.1