AGX Dynamics 2.42.3.0
Loading...
Searching...
No Matches
agxCollide::Plane Class Reference

#include <Plane.h>

+ Inheritance diagram for agxCollide::Plane:

Public Member Functions

 Plane ()
 Default constructor.
 
 Plane (agx::Real const a, agx::Real const b, agx::Real const c, agx::Real d)
 Constructor, using plane equation ax+by+cz+d=0.
 
 Plane (const agx::Vec3 normal, agx::Real d)
 Constructor.
 
 Plane (const agx::Vec3 normal, const agx::Vec3 point)
 Constructor.
 
 Plane (const agx::Vec3 p1, const agx::Vec3 p2, const agx::Vec3 p3)
 Create a plane which is spanned using three distinct points.
 
 Plane (const agx::Vec4 plane)
 
 AGXSTREAM_DECLARE_SERIALIZABLE_BASE (agxCollide::Plane)
 
agx::Vec4 asVec4 () const
 
virtual agx::SPDMatrix3x3 calculateInertia (agx::Real mass) const override
 Calculate the inertia for the shape given a mass.
 
virtual BoundingAABB calculateLocalBound () const override
 Calculate the bounding volume in the local coordinate system.
 
agx::Vec4 calculatePlane (const agx::AffineMatrix4x4 &transform) const
 
virtual Shape * clone () const override
 Create a clone.
 
agx::Real getDistance () const
 Get the distance d (from plane equation ax+by+cz+d=0).
 
agx::Physics::Geometry::PlanePtr getEntity () const
 
const agx::Vec3 getNormal () const
 Get the normal (a, b, c) from plane equation ax+by+cz+d=0.
 
virtual agx::Real getVolume () const override
 Return the volume of the shape.
 
void set (const agx::Vec3 &p1, const agx::Vec3 &p2, const agx::Vec3 &p3)
 
void set (const agx::Vec4 &plane)
 
void setDistance (agx::Real distance)
 Set the distance d (from plane equation ax+by+cz+d=0).
 
void setNormal (const agx::Vec3 &normal)
 Set the normal (a, b, c) from plane equation ax+by+cz+d=0.
 
agx::Real signedDistanceToPoint (const agx::Vec3 &point) const
 Calculates the distance from the plane to a point.
 
virtual const BoundingAABB & updateBoundingVolume () override
 Calculate the bounding volume based on the current Shape parameters including transformation.
 
- Public Member Functions inherited from agxCollide::Shape
ShapeGroup * asGroup ()
 Auto-cast shape to group.
 
const ShapeGroup * asGroup () const
 Auto-cast shape to group.
 
virtual agx::Real calculateBoundingRadius (BoundingAABB &localAABB) const
 Calculate the bounding volume (AABB) into localAABB and calculate the bounding radius based on the new AABB size.
 
virtual agx::SPDMatrix3x3 calculateInertia (agx::Real mass) const =0
 Calculate the inertia for the shape given a mass.
 
virtual BoundingAABB calculateLocalBound () const =0
 Calculate the bounding volume in the local coordinate system.
 
virtual Shape * clone () const
 Create a clone.
 
const BoundingAABB & getBoundingVolume () const
 
virtual agx::Vec3 getCenter () const
 
agx::Physics::Geometry::ShapePtr getEntity () const
 
Geometry * getGeometry ()
 
const Geometry * getGeometry () const
 
agx::AffineMatrix4x4 getLocalTransform () const
 
agx::UInt32 getModifiedCount () const
 
agxCollide::RenderData * getRenderData ()
 If this is a ShapeGroup, then this method will return nullptr as the render data is stored in the actual children (Box, Mesh etc.
 
const agxCollide::RenderData * getRenderData () const
 If this is a ShapeGroup, then this method will return nullptr as the render data is stored in the actual children (Box, Mesh etc.
 
virtual agx::Vec3 getSupportPoint (const agx::Vec3 &supportDirection) const
 Returns the support point on face of the shape.
 
agx::AffineMatrix4x4 getTransform () const
 
agx::UInt8 getType () const
 
const char * getTypeName () const
 
virtual agx::Real getVolume () const =0
 Return the volume of the shape.
 
virtual bool hasSupportFunction () const
 
bool isGroup () const
 
virtual void propagateTransform (const agx::AffineMatrix4x4 &transform)
 
virtual void setRenderData (agxCollide::RenderData *renderData)
 Store render data with the Shape.
 
virtual const BoundingAABB & updateBoundingVolume ()=0
 Calculate the bounding volume based on the current Shape parameters including transformation.
 
- Public Member Functions inherited from agx::Referenced
 Referenced ()
 Default constructor.
 
 Referenced (const Referenced &)
 
template<typename T >
T * as ()
 Subclass casting.
 
template<typename T >
const T * as () const
 
template<typename T >
T * asSafe ()
 Safe subclass casting, return nullptr if template type does not match.
 
template<typename T >
const T * asSafe () const
 
int getReferenceCount () const
 
template<typename T >
bool is () const
 Subclass test.
 
Referenced & operator= (const Referenced &)
 Assignment operator. Will increment the number of references to the referenced object.
 
void reference (void *ptr=nullptr) const
 Explicitly increment the reference count by one, indicating that this object has another pointer which is referencing it.
 
void unreference (void *ptr=nullptr) const
 Decrement the reference count by one, indicating that a pointer to this object is referencing it.
 
void unreference_nodelete () const
 Decrement the reference count by one, indicating that a pointer to this object is referencing it.
 
- Public Member Functions inherited from agxStream::Serializable
virtual ~Serializable ()
 Destructor for normal C++ use but hidden from SWIG bindings.
 
virtual const char * getClassName () const
 
bool getEnableSerialization () const
 
bool getEnableUuidGeneration ()
 
agx::UInt32 getIndex () const
 This index is given at creation of this object.
 
virtual StorageAgent * getStorageAgent () const =0
 
agx::Uuid getUuid () const
 
bool isFinished () const
 
void setEnableSerialization (bool flag)
 Set to false to disable serialization of this object.
 
void setFinished ()
 Tells this class that it is restored correctly and should not be deleted during destruction of an Archive.
 
void setUuid (const agx::Uuid &uuid)
 Explicitly set a Uuid on a serializable object.
 

Static Public Member Functions

static BoundingAABB calculateBound (const agx::AffineMatrix4x4 &transform, const agx::Plane &plane)
 
static agxStream::Serializable * create (agxStream::InputArchive &)
 
- Static Public Member Functions inherited from agxCollide::Shape
static BoundingAABB calculateBound (const agx::AffineMatrix4x4 &transform, const BoundingAABB &localBound)
 
static const char * getTypeName (agx::UInt8 type)
 
- Static Public Member Functions inherited from agx::Referenced
template<typename T >
static bool ValidateCast (const Referenced *object)
 
- Static Public Member Functions inherited from agxStream::Serializable
static void setEnableUuidGeneration (bool flag)
 Specify if there should be UUID:s generated for each new Serializable object. By default it is enabled.
 

Protected Member Functions

virtual ~Plane ()
 
Plane & operator= (const Plane &)
 
- Protected Member Functions inherited from agxCollide::Shape
 Shape (Type type, agx::Physics::Geometry::ShapePtr entity=agx::Physics::Geometry::ShapeModel::createInstance())
 Constructor.
 
virtual ~Shape ()
 Destructor.
 
agx::UInt32 incrementModifiedCount ()
 Increment the number of times the shape have been modified.
 
void syncronizeShapeIndex ()
 
- Protected Member Functions inherited from agx::Referenced
virtual ~Referenced ()
 Destructor.
 
void allocateObserverVector () const
 
void deleteUsingDeleteHandler () const
 
- Protected Member Functions inherited from agxStream::Serializable
 Serializable ()
 Default constructor.
 
 Serializable (const Serializable &other)
 Copy constructor.
 
void generateUuid ()
 

Additional Inherited Members

- Public Types inherited from agxCollide::Shape
enum  Type {
  GROUP , BOX , CAPSULE , CYLINDER ,
  LINE , PLANE , SPHERE , TRIMESH ,
  HEIGHT_FIELD , CONVEX , WIRE_SHAPE , CONE ,
  HOLLOW_CONE , HOLLOW_CYLINDER , TIRE_SHAPE , NUM_TYPES
}
 Define the type of a Shape. More...
 
- Static Protected Member Functions inherited from agx::Referenced
static DeleteHandler * getDeleteHandler ()
 
static void setDeleteHandler (DeleteHandler *handler)
 Internal: Set a DeleteHandler to which deletion of all referenced counted objects will be delegated to.
 
- Protected Attributes inherited from agxCollide::Shape
agx::Physics::Geometry::ShapeRef m_entity
 
Geometry * m_geometry
 
agx::ref_ptr< agx::Referenced > m_internalData
 
ShapeGroup * m_parent
 
agxCollide::RenderDataRef m_renderData
 
agx::Index m_shapeIndex
 
- Protected Attributes inherited from agx::Referenced
Mutex m_mutex
 
ObserverContainer m_observers
 
AtomicValue m_refCount
 

Detailed Description

Definition at line 34 of file agxCollide/Plane.h.

Constructor & Destructor Documentation

◆ Plane() [1/6]

agxCollide::Plane::Plane ( )

Default constructor.

◆ Plane() [2/6]

agxCollide::Plane::Plane ( agx::Real const  a,
agx::Real const  b,
agx::Real const  c,
agx::Real  d 
)

Constructor, using plane equation ax+by+cz+d=0.

◆ Plane() [3/6]

agxCollide::Plane::Plane ( const agx::Vec3  normal,
agx::Real  d 
)

Constructor.

Parameters
normalplane normal (a,b,c) in plane equation
ddistance

◆ Plane() [4/6]

agxCollide::Plane::Plane ( const agx::Vec3  normal,
const agx::Vec3  point 
)

Constructor.

Parameters
normal- Normal (a,b,c) in the plane equation
point- A point on the plane

◆ Plane() [5/6]

agxCollide::Plane::Plane ( const agx::Vec4  plane)

◆ Plane() [6/6]

agxCollide::Plane::Plane ( const agx::Vec3  p1,
const agx::Vec3  p2,
const agx::Vec3  p3 
)

Create a plane which is spanned using three distinct points.

◆ ~Plane()

virtual agxCollide::Plane::~Plane ( )
protectedvirtual

Member Function Documentation

◆ AGXSTREAM_DECLARE_SERIALIZABLE_BASE()

agxCollide::Plane::AGXSTREAM_DECLARE_SERIALIZABLE_BASE ( agxCollide::Plane  )

◆ asVec4()

agx::Vec4 agxCollide::Plane::asVec4 ( ) const

◆ calculateBound()

BoundingAABB agxCollide::Plane::calculateBound ( const agx::AffineMatrix4x4 &  transform,
const agx::Plane &  plane 
)
static

◆ calculateInertia()

virtual agx::SPDMatrix3x3 agxCollide::Plane::calculateInertia ( agx::Real  mass) const
overridevirtual

Calculate the inertia for the shape given a mass.

Returns
Matrix with inertia in shape coordinate system

Implements agxCollide::Shape.

◆ calculateLocalBound()

virtual BoundingAABB agxCollide::Plane::calculateLocalBound ( ) const
overridevirtual

Calculate the bounding volume in the local coordinate system.

Returns
the calculated bounding volume.

Implements agxCollide::Shape.

◆ calculatePlane()

agx::Vec4 agxCollide::Plane::calculatePlane ( const agx::AffineMatrix4x4 &  transform) const

◆ clone()

virtual Shape * agxCollide::Plane::clone ( ) const
overridevirtual

Create a clone.

Reimplemented from agxCollide::Shape.

◆ create()

static agxStream::Serializable * agxCollide::Plane::create ( agxStream::InputArchive &  )
inlinestatic

Definition at line 106 of file agxCollide/Plane.h.

◆ getDistance()

agx::Real agxCollide::Plane::getDistance ( ) const

Get the distance d (from plane equation ax+by+cz+d=0).

Definition at line 123 of file agxCollide/Plane.h.

References agx::PlaneT< T >::getDistance(), getEntity(), and agx::Physics::Geometry::PlanePtr::plane().

Referenced by signedDistanceToPoint().

◆ getEntity()

agx::Physics::Geometry::PlanePtr agxCollide::Plane::getEntity ( ) const
inline

Definition at line 120 of file agxCollide/Plane.h.

References agxCollide::Shape::m_entity.

Referenced by getDistance(), and getNormal().

◆ getNormal()

const agx::Vec3 agxCollide::Plane::getNormal ( ) const

Get the normal (a, b, c) from plane equation ax+by+cz+d=0.

Definition at line 122 of file agxCollide/Plane.h.

References getEntity(), agx::PlaneT< T >::getNormal(), and agx::Physics::Geometry::PlanePtr::plane().

Referenced by signedDistanceToPoint().

◆ getVolume()

virtual agx::Real agxCollide::Plane::getVolume ( ) const
overridevirtual

Return the volume of the shape.

Implements agxCollide::Shape.

◆ operator=()

Plane & agxCollide::Plane::operator= ( const Plane &  )
inlineprotected

Definition at line 111 of file agxCollide/Plane.h.

◆ set() [1/2]

void agxCollide::Plane::set ( const agx::Vec3 &  p1,
const agx::Vec3 &  p2,
const agx::Vec3 &  p3 
)

◆ set() [2/2]

void agxCollide::Plane::set ( const agx::Vec4 &  plane)

◆ setDistance()

void agxCollide::Plane::setDistance ( agx::Real  distance)

Set the distance d (from plane equation ax+by+cz+d=0).

◆ setNormal()

void agxCollide::Plane::setNormal ( const agx::Vec3 &  normal)

Set the normal (a, b, c) from plane equation ax+by+cz+d=0.

◆ signedDistanceToPoint()

agx::Real agxCollide::Plane::signedDistanceToPoint ( const agx::Vec3 &  point) const

Calculates the distance from the plane to a point.

Negative value if the point is behind the plane, otherwise positive.

Definition at line 125 of file agxCollide/Plane.h.

References getDistance(), and getNormal().

◆ updateBoundingVolume()

virtual const BoundingAABB & agxCollide::Plane::updateBoundingVolume ( )
overridevirtual

Calculate the bounding volume based on the current Shape parameters including transformation.

Returns
new calculated bounding volume

Implements agxCollide::Shape.


The documentation for this class was generated from the following file: