17 #ifndef AGXCOLLIDE_SHAPE_H
18 #define AGXCOLLIDE_SHAPE_H
84 virtual Shape *clone()
const;
89 const char* getTypeName()
const;
104 ShapeGroup* asGroup();
109 const ShapeGroup* asGroup()
const;
120 virtual bool hasSupportFunction()
const;
178 const Geometry* getGeometry()
const;
201 void store( agxStream::OutputArchive&
out ) const override;
202 void restore( agxStream::InputArchive&
in ) override;
211 virtual
void setRenderData( agxCollide::
RenderData *renderData );
218 const agxCollide::
RenderData* getRenderData( ) const;
234 agx::
UInt32 incrementModifiedCount();
242 Shape& operator=(const Shape&) = delete;
249 friend class ShapeGroup;
252 friend class agxTerrain::Terrain;
255 virtual
void setGeometry(Geometry* geometry);
256 virtual
void transfer(Space* space);
258 virtual
void updateGeometryPtr();
263 void syncronizeShapeIndex();
266 Geometry* m_geometry;
270 ShapeGroup* m_parent;
282 virtual Shape *clone()
const override;
285 void removeChild(Shape* shape);
286 void removeChild(
size_t index);
297 size_t getNumChildren()
const;
298 Shape* getChild(
size_t index);
299 const Shape* getChild(
size_t index)
const;
321 virtual agx::Real getVolume()
const override;
327 virtual const BoundingAABB& updateBoundingVolume()
override;
330 virtual BoundingAABB calculateLocalBound()
const override;
337 virtual ~ShapeGroup();
340 friend class Geometry;
343 virtual void updateGeometryPtr()
override;
344 virtual void setGeometry(Geometry* geometry)
override;
345 virtual void transfer(Space* space)
override;
357 const Shape* getShape()
const;
360 bool isValid()
const;
379 return m_entity.type();
388 return static_cast<ShapeGroup*
>(
this);
392 return const_cast<Shape*
>(
this)->asGroup();
409 return m_entity.transform();
414 return m_entity.boundingAABB();
424 return m_children.size();
428 return m_children[index];
432 return m_children[index];
436 return getEntity().childTransforms()[index];
456 return m_entity.modifiedCount();
461 return ++m_entity.modifiedCount();
468 return m_shapes[m_index];
473 return const_cast<ShapeIterator*
>(
this)->getShape();
479 return m_transforms[m_index];
484 return m_index < m_shapes.size();
agx::AffineMatrix4x4 getTransform() const
ShapeGroup * asGroup()
Auto-cast shape to group.
InputRef< T > in(const char *name, T &obj)
Create an object with a name and a reference to the object that should be restored (usually a pointer...
AGXCORE_EXPORT Type * getType(const agx::String &name)
agx::Vector< agx::ref_ptr< Shape > > ShapeRefVector
Vec3T< Real > Vec3
The object holding 3 dimensional vectors and providing basic arithmetic.
virtual agx::Vec3 getCenter() const
OutputRef< Serializable > out(const char *name, const Serializable *obj)
Return an object that contain the name and the object that should be serialized to an archive...
agx::UInt32 incrementModifiedCount()
Increment the number of times the shape have been modified.
Class for storing rendering information for a Shape.
void AGXCORE_EXPORT transform(void *target, const Format *targetFormat, const void *source, const Format *sourceFormat, size_t numElements)
Transform data between two buffers.
#define AGXPHYSICS_EXPORT
Pointer to a entity instance of type Physics.Geometry.Shape.
virtual bool hasSupportFunction() const
agx::Physics::Geometry::ShapePtr getEntity() const
Base class providing referencing counted objects.
The geometry representation used by the collision detection engine.
AGXMODEL_EXPORT agx::Vec3 getCenter(const agxCollide::Mesh::Triangle &triangle)
Real calculateBoundingRadius(Real)
Vector containing 'raw' data.
static BoundingAABB calculateBound(const agx::AffineMatrix4x4 &transform, const BoundingAABB &localBound)
This class contains all Geometries and performs Broad Phase and Narrow Phase collision detection to c...
Specialized type of matrices for holding symmetric positive definite matrices.
agx::UInt32 getModifiedCount() const
AGX_DECLARE_VECTOR_TYPES(Geometry)
const BoundingAABB & getBoundingVolume() const
#define AGXSTREAM_DECLARE_SERIALIZABLE(T)
Use this in a Serializable class to add the required methods Important: Use full namespace in the dec...
Type
Define the type of a Shape.
This class is an abstract base class for all classes that can be stored and retrieved from an Archive...
#define AGXSTREAM_DECLARE_ABSTRACT_SERIALIZABLE(T)
Use this in a pure abstract Serializable class to add the required methods Important: Use full namesp...
Axis aligned bounding box implementation.
#define DOXYGEN_END_INTERNAL_BLOCK()
#define DOXYGEN_START_INTERNAL_BLOCK()
AGX_DECLARE_POINTER_TYPES(SpaceListener)
AGXCORE_EXPORT EntityModel * getEntity(const agx::Path &path)
Get a entity with a specified path.
virtual agx::Vec3 getSupportPoint(const agx::Vec3 &supportDirection) const
Returns the support point on face of the shape.
Pointer to a entity instance of type Physics.Geometry.ShapeGroup.