AGX Dynamics 2.42.3.0
Loading...
Searching...
No Matches
agxRender/RenderProxyFactory.h
Go to the documentation of this file.
1/*
2Copyright 2007-2025. 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#pragma once
17
19#include <agx/Referenced.h>
20#include <agx/HashVector.h>
21#include <agx/AffineMatrix4x4.h>
22#include <agxCollide/Space.h>
23
26#include <agxRender/Graph.h>
27
28namespace agxCollide
29{
30 class Sphere;
31 class Box;
32 class Plane;
33 class Convex;
34 class Plane;
35 class Cylinder;
36 class Cone;
37 class Line;
38 class HollowCylinder;
39 class HollowCone;
40}
41
42namespace agxRender
43{
44
54 {
55 public:
57
59 virtual SphereProxy* createSphere(float radius) = 0;
60
63
65 virtual BoxProxy* createBox(const agx::Vec3& halfExtents) = 0;
66
68 virtual BoxProxy* createBox(agxCollide::Box* shape) = 0;
69
71 virtual LineProxy* createLine(const agx::Vec3& p1, const agx::Vec3& p2) = 0;
72
75
77 virtual CylinderProxy* createCylinder(float radius, float height) = 0;
78
81
83 virtual HollowCylinderProxy* createHollowCylinder(float outerRadius, float height, float thickness) = 0;
84
87
89 virtual ConeProxy* createCone(float radius, float height) = 0;
90
93
95 virtual TruncatedConeProxy* createTruncatedCone(float topRadius, float bottomRadius, float height) = 0;
96
98 virtual HollowConeProxy* createHollowCone(float topRadius, float bottomRadius, float height, float thickness) = 0;
99
102
104 virtual CapsuleProxy* createCapsule(float radius, float height) = 0;
105
108
110 virtual agxRender::WireShapeProxy* createWireShape(float radius, float height,
111 const agx::Vec3& previousEndPoint0, const agx::Vec3& previousEndPoint1) = 0;
112
114 virtual TextProxy* createText(const agx::String& text, const agx::Vec3& pos, float size = 1) = 0;
115
117 virtual PlaneProxy* createPlane(const agx::Vec3& normal, agx::Real distance) = 0;
118
121
124
127
130
131 virtual agxRender::WireRenderProxy* createWire(float radius, const agx::Vec3& color) = 0;
132
141
142
144 agxData::Buffer* positions,
145 agxData::Buffer* rotations,
146 agxData::Buffer* radii,
147 agxData::Buffer* colors,
148 agxData::Buffer* enableRendering,
149 agxData::Value* bound,
150 agx::Component* context) = 0;
151
154
156 SphereProxy* create(float radius);
157
159 BoxProxy* create(const agx::Vec3& halfExtents);
160
162 LineProxy* create(const LineProxy*);
163
165 CylinderProxy* create(const CylinderProxy*);
166
169
171 ConeProxy* create(const ConeProxy*);
172
175
177 HollowConeProxy* create(const HollowConeProxy*);
178
180 CapsuleProxy* create(const CapsuleProxy*);
181
183 TextProxy* create(const TextProxy*);
184
186 PlaneProxy* create(const PlaneProxy*);
187
190
193
200
206
210 RenderProxy::RenderMode getDefaultRenderMode() const;
211
212 void setEnable(bool flag);
213 bool getEnable() const;
214
215 protected:
216 friend class RenderManager;
217
218 virtual void setRenderManager(RenderManager* mgr) {
219 m_mgr = mgr;
220 }
221
226 };
227
228 inline void RenderProxyFactory::setEnable(bool flag)
229 {
230 m_enabled = flag;
231 }
233 {
234 return m_enabled;
235 }
236}
#define AGX_DECLARE_POINTER_TYPES(type)
Definition: Referenced.h:254
#define AGXPHYSICS_EXPORT
A box shape for geometric intersection tests.
Definition: Box.h:33
Implements a Capsule shape for geometric intersection tests.
Definition: Capsule.h:35
A right circular cone shape for geometric intersection tests.
Definition: Cone.h:49
A cylinder shape for geometric intersection tests.
Definition: Cylinder.h:35
A HeightField is a collision shape that can be created from a grid structure, like an image.
A right circular hollow cone shape for geometric intersection tests.
Definition: HollowCone.h:46
A hollow cylinder shape for geometric intersection tests.
A line shape for intersection tests, mostly for depth sensing and picking.
A sphere class for geometric intersection tests.
Definition: Sphere.h:32
Triangle mesh for geometric intersection tests.
Definition: Trimesh.h:40
Abstract representation of a data buffer.
Definition: Buffer.h:56
Abstract representation of a value.
Definition: Value.h:49
Subclass that implements a BoxProxy.
Subclass that implements a CapsuleProxy.
Subclass that implements a ConeProxy.
Class holding contacts that makes it possible to batch render these objects.
Subclass that implements a CylinderProxy.
Abstract base class that acts as an interface and can render the data from a Graph.
Definition: Graph.h:45
Subclass that implements a HeightfieldProxy.
Subclass that implements a HollowConeProxy.
Subclass that implements a CylinderProxy.
Subclass that implements a LineProxy.
Subclass that implements a PlaneProxy.
Class for managing the rendering of geometries, shapes, rigid bodies, constraints etc.
Abstract class which is responsible for returning a pointer to a specified RenderProxy type.
virtual LineProxy * createLine(agxCollide::Line *shape)=0
Interface for creating and returning a LineProxy.
virtual CapsuleProxy * createCapsule(float radius, float height)=0
Interface for creating and returning a CapsuleProxy.
virtual LineProxy * createLine(const agx::Vec3 &p1, const agx::Vec3 &p2)=0
Interface for creating and returning a LineProxy.
virtual agxRender::WireRenderProxy * createWire(float radius, const agx::Vec3 &color)=0
virtual agxRender::RigidBodyBatchRenderProxy * createRigidBodies(const agx::RigidBodyPtrSetVector *)=0
Interface for creating and returning batch rendering of rigid bodies (cm).
void setDefaultRenderMode(RenderProxy::RenderMode mode)
Set the default RenderMode that will be used when a new RenderProxy is created.
virtual PlaneProxy * createPlane(agxCollide::Plane *shape)=0
Interface for creating and returning PlaneProxy.
virtual CapsuleProxy * createCapsule(agxCollide::Capsule *shape)=0
Interface for creating and returning a CapsuleProxy.
virtual void setGlobalTransform(const agx::AffineMatrix4x4 &)
Set a transformation which could be applied to all transformations for RenderProxy's.
virtual ConeProxy * createCone(float radius, float height)=0
Interface for creating and returning a ConeProxy.
virtual TextProxy * createText(const agx::String &text, const agx::Vec3 &pos, float size=1)=0
Interface for creating and returning TextProxy.
virtual agxRender::WireShapeProxy * createWireShape(float radius, float height, const agx::Vec3 &previousEndPoint0, const agx::Vec3 &previousEndPoint1)=0
Interface for creating and returning a WireShapeProxy.
virtual TruncatedConeProxy * createCone(agxCollide::Cone *shape)=0
Interface for creating and returning a ConeProxy.
virtual agxRender::TrimeshProxy * createTrimesh(agxCollide::Trimesh *mesh)=0
Interface for creating and returning TrimeshProxy.
virtual BoxProxy * createBox(const agx::Vec3 &halfExtents)=0
Interface for creating and returning a BoxProxy.
virtual Graph::GraphRenderer * getGraphRenderer()=0
This method should create and return an implementation of a GraphRenderer, a class that can render th...
virtual HollowConeProxy * createHollowCone(float topRadius, float bottomRadius, float height, float thickness)=0
Interface for creating and returning a HollowConeProxy.
virtual PlaneProxy * createPlane(const agx::Vec3 &normal, agx::Real distance)=0
Interface for creating and returning PlaneProxy.
virtual TruncatedConeProxy * createTruncatedCone(float topRadius, float bottomRadius, float height)=0
Interface for creating and returning a TruncatedConeProxy.
virtual void setRenderManager(RenderManager *mgr)
virtual HollowCylinderProxy * createHollowCylinder(agxCollide::HollowCylinder *shape)=0
Interface for creating and returning a HollowCylinderProxy.
virtual CylinderProxy * createCylinder(agxCollide::Cylinder *shape)=0
Interface for creating and returning a CylinderProxy.
virtual SphereProxy * createSphere(agxCollide::Sphere *shape)=0
Interface for creating and returning a SphereProxy.
virtual HeightFieldProxy * createHeightfield(agxCollide::HeightField *shape)=0
Interface for creating and returning HeightfieldProxy.
virtual agxRender::ContactsProxy * createContacts(const agxCollide::GeometryContactPtrVector &)=0
Interface for creating and returning ContactsProxy.
virtual BoxProxy * createBox(agxCollide::Box *shape)=0
Interface for creating and returning a BoxProxy.
virtual HollowCylinderProxy * createHollowCylinder(float outerRadius, float height, float thickness)=0
Interface for creating and returning a HollowCylinderProxy.
virtual CylinderProxy * createCylinder(float radius, float height)=0
Interface for creating and returning a CylinderProxy.
virtual HollowConeProxy * createHollowCone(agxCollide::HollowCone *shape)=0
Interface for creating and returning a HollowCone.
virtual SphereProxy * createSphere(float radius)=0
Interface for creating and returning a SphereProxy.
virtual RenderProxy * createSphereBatchRenderer(agxData::Buffer *positions, agxData::Buffer *rotations, agxData::Buffer *radii, agxData::Buffer *colors, agxData::Buffer *enableRendering, agxData::Value *bound, agx::Component *context)=0
Abstract base class which encapsulated information for rendering a specific shape.
Class holding rigid bodies that makes it possible to batch render these objects.
Subclass that implements a SphereProxy.
Subclass that implements a TextProxy.
Subclass that implements a TrimeshProxy.
Subclass that implements a TruncatedConeProxy.
Subclass that implements a WireShapeProxy.
A component is an object containing other objects, enabling hierarchical structuring.
Definition: Component.h:39
Base class providing referencing counted objects.
Definition: Referenced.h:120
This namespace consists of a set of classes for handling geometric intersection tests including boole...
Namespace containing classes for handling debug rendering of collision geometries,...
Definition: Constraint.h:36
PlaneT< agx::Real > Plane
Definition: agx/Plane.h:121
double Real
Definition: Real.h:41
LineT< Vec3 > Line
Definition: agx/Line.h:39