AGX Dynamics 2.38.0.2
Loading...
Searching...
No Matches
WireShape.h
Go to the documentation of this file.
1/*
2Copyright 2007-2024. Algoryx Simulation AB.
3
4All AGX source code, intellectual property, documentation, sample code,
5tutorials, scene files and technical white papers, are copyrighted, proprietary
6and confidential material of Algoryx Simulation AB. You may not download, read,
7store, distribute, publish, copy or otherwise disseminate, use or expose this
8material unless having a written signed agreement with Algoryx Simulation AB, or having been
9advised so by Algoryx Simulation AB for a time limited evaluation, or having purchased a
10valid commercial license from Algoryx Simulation AB.
11
12Algoryx Simulation AB disclaims all responsibilities for loss or damage caused
13from using this software, unless otherwise stated in written agreements with
14Algoryx Simulation AB.
15*/
16
17#pragma once
18
21#include <agxCollide/Shape.h>
22#include <agxCollide/Capsule.h>
24
25namespace agxCollide
26{
28
44 {
45 public:
54 const agx::Real radius, const agx::Real height,
55 const agx::Vec3 previousEndPoint0 = agx::Vec3(),
56 const agx::Vec3 previousEndPoint1 = agx::Vec3());
57
61 agx::Vec3 getPreviousEndPoint0() const;
62
66 agx::Vec3 getPreviousEndPoint1() const;
67
68 /*
69 Sets radius, height, and the first previous end points for continuous collision detection.
70 \param worldTransform New world transform of this wire shape.
71 \param radius The new radius.
72 \param height The new height.
73 \param previousEndPoint0 Corresponding to local Vec3(0, -0.5h, 0), but in world coordinates.
74 \param previousEndPoint1 Corresponding to local Vec3(0, 0.5h, 0), but in world coordinates.
75 */
76 agxCollide::BoundingAABB set( const agx::AffineMatrix4x4& worldTransform, const agx::Real radius, const agx::Real height, const agx::Vec3& previousEndPoint0, const agx::Vec3& previousEndPoint1 );
77
78 virtual const BoundingAABB& updateBoundingVolume() override;
79 virtual BoundingAABB calculateLocalBound() const override;
80 static BoundingAABB calculateBound( const agx::AffineMatrix4x4& transform, const agx::Real radius, const agx::Real height, const agx::Vec3& previousEndPoint0, const agx::Vec3& previousEndPoint1 );
81
83
85
86 protected:
88 virtual ~WireShape();
89 };
90
91 /* Implementation */
96
101
106
107 AGX_FORCE_INLINE BoundingAABB WireShape::calculateBound( const agx::AffineMatrix4x4& transform, const agx::Real radius, const agx::Real height, const agx::Vec3& previousEndPoint0, const agx::Vec3& previousEndPoint1 )
108 {
109 const agx::Vec3 p1 = agx::Vec3( 0, height * agx::Real( 0.5 ), 0 ) * transform;
110 const agx::Vec3 p2 = agx::Vec3( 0, height * agx::Real( -0.5 ), 0 ) * transform;
111 const agx::Vec3& p3 = previousEndPoint0;
112 const agx::Vec3& p4 = previousEndPoint1;
113 const agx::Vec3 rVec( radius );
114
117 return bound;
118 }
119
120}
#define AGX_DECLARE_POINTER_TYPES(type)
Definition Referenced.h:254
#define AGXSTREAM_DECLARE_SERIALIZABLE(T)
Use this in a Serializable class to add the required methods Important: Use full namespace in the dec...
#define AGXPHYSICS_EXPORT
Axis aligned bounding box implementation.
Implements a Capsule shape for geometric intersection tests.
Definition Capsule.h:35
agx::Physics::Geometry::ShapeRef m_entity
Definition Shape.h:266
Internal class used by agxWire::Wire.
Definition WireShape.h:44
agx::Vec3 getPreviousEndPoint0() const
Definition WireShape.h:97
agx::Vec3 getPreviousEndPoint1() const
Definition WireShape.h:102
WireShape(const agx::Real radius, const agx::Real height, const agx::Vec3 previousEndPoint0=agx::Vec3(), const agx::Vec3 previousEndPoint1=agx::Vec3())
Constructor.
virtual const BoundingAABB & updateBoundingVolume() override
Calculate the bounding volume based on the current Shape parameters including transformation.
agx::Physics::Geometry::WireShapePtr getEntity() const
Definition WireShape.h:92
agxCollide::BoundingAABB set(const agx::AffineMatrix4x4 &worldTransform, const agx::Real radius, const agx::Real height, const agx::Vec3 &previousEndPoint0, const agx::Vec3 &previousEndPoint1)
static BoundingAABB calculateBound(const agx::AffineMatrix4x4 &transform, const agx::Real radius, const agx::Real height, const agx::Vec3 &previousEndPoint0, const agx::Vec3 &previousEndPoint1)
Definition WireShape.h:107
virtual BoundingAABB calculateLocalBound() const override
Calculate the bounding volume in the local coordinate system.
Pointer to a entity instance of type Physics.Geometry.WireShape.
AGXPHYSICS_EXPORT agx::Vec3 & previousPoint0()
AGXPHYSICS_EXPORT agx::Vec3 & previousPoint1()
static Vec3T componentMax(const Vec3T &v1, const Vec3T &v2)
Creates a new vector where each component is the maximum of this and the other vector.
static Vec3T componentMin(const Vec3T &v1, const Vec3T &v2)
Creates a new vector where each component is the minimum of this and the other vector.
#define AGX_FORCE_INLINE
Definition macros.h:58
This namespace consists of a set of classes for handling geometric intersection tests including boole...
Vec3T< Real > Vec3
The object holding 3 dimensional vectors and providing basic arithmetic.
Definition agx/Vec3.h:36
double Real
Definition Real.h:42