18 #include "pandabase.h"
20 #include "callbackObject.h"
22 #include "physxObject.h"
23 #include "physxObjectCollection.h"
24 #include "physxEnums.h"
25 #include "physxContactReport.h"
26 #include "physxControllerReport.h"
27 #include "physxTriggerReport.h"
28 #include "physxOverlapReport.h"
29 #include "physxMask.h"
30 #include "physxGroupsMask.h"
31 #include "physx_includes.h"
79 void simulate(
float dt);
81 void set_timing_variable();
82 void set_timing_fixed(
float maxTimestep=1.0f/60.0f,
unsigned int maxIter=8);
86 void enable_contact_reporting(
bool enabled);
87 bool is_contact_reporting_enabled()
const;
88 void enable_trigger_reporting(
bool enabled);
89 bool is_trigger_reporting_enabled()
const;
90 void enable_controller_reporting(
bool enabled);
91 bool is_controller_reporting_enabled()
const;
93 INLINE
void set_controller_shape_hit_callback(PT(
CallbackObject) cbobj);
94 INLINE
void set_controller_controller_hit_callback(PT(
CallbackObject) cbobj);
96 void set_gravity(
const LVector3f &gravity);
100 bool get_flag(PhysxSceneFlag flag)
const;
101 bool is_hardware_scene()
const;
104 unsigned int get_num_actors()
const;
106 PhysxActor *get_actor(
unsigned int idx)
const;
107 MAKE_SEQ(get_actors, get_num_actors, get_actor);
110 unsigned int get_num_joints()
const;
112 PhysxJoint *get_joint(
unsigned int idx)
const;
113 MAKE_SEQ(get_joints, get_num_joints, get_joint);
116 unsigned int get_num_materials()
const;
117 unsigned int get_hightest_material_index()
const;
121 PhysxMaterial *get_material_from_index(
unsigned int idx)
const;
122 MAKE_SEQ(get_materials, get_num_materials, get_material);
125 unsigned int get_num_controllers()
const;
128 MAKE_SEQ(get_controllers, get_num_controllers, get_controller);
131 unsigned int get_num_force_fields()
const;
134 MAKE_SEQ(get_force_fields, get_num_force_fields, get_force_field);
137 unsigned int get_num_force_field_shape_groups()
const;
140 MAKE_SEQ(get_force_field_shape_groups, get_num_force_field_shape_groups, get_force_field_shape_group);
143 unsigned int get_num_cloths()
const;
145 PhysxCloth *get_cloth(
unsigned int idx)
const;
146 MAKE_SEQ(get_cloths, get_num_cloths, get_cloth);
149 unsigned int get_num_soft_bodies()
const;
152 MAKE_SEQ(get_soft_bodies, get_num_soft_bodies, get_soft_body);
155 unsigned int get_num_vehicles()
const;
158 MAKE_SEQ(get_vehicles, get_num_vehicles, get_vehicle);
161 bool raycast_any_shape(
const PhysxRay &ray,
162 PhysxShapesType shapesType=ST_all,
167 PhysxShapesType shapesType=ST_all,
172 PhysxShapesType shapesType=ST_all,
176 bool raycast_any_bounds(
const PhysxRay &ray,
177 PhysxShapesType shapesType=ST_all,
182 PhysxShapesType shapesType=ST_all,
187 PhysxShapesType shapesType=ST_all,
193 PhysxShapesType shapesType=ST_all,
197 PhysxShapesType shapesType=ST_all,
201 void set_actor_pair_flag(
PhysxActor &actorA,
PhysxActor &actorB, PhysxContactPairFlag flag,
bool value);
203 void set_actor_group_pair_flag(
unsigned int g1,
unsigned int g2, PhysxContactPairFlag flag,
bool value);
204 void set_group_collision_flag(
unsigned int g1,
unsigned int g2,
bool enable);
205 void set_filter_ops(PhysxFilterOp op0, PhysxFilterOp op1, PhysxFilterOp op2);
206 void set_filter_bool(
bool flag);
213 bool get_actor_group_pair_flag(
unsigned int g1,
unsigned int g2, PhysxContactPairFlag flag);
214 bool get_group_collision_flag(
unsigned int g1,
unsigned int g2);
215 bool get_filter_bool()
const;
218 PhysxFilterOp get_filter_op0()
const;
219 PhysxFilterOp get_filter_op1()
const;
220 PhysxFilterOp get_filter_op2()
const;
227 INLINE
void ls()
const;
228 INLINE
void ls(ostream &out,
int indent_level=0)
const;
231 INLINE NxScene *ptr()
const {
return _ptr; };
232 INLINE NxControllerManager *cm()
const {
return _cm; };
234 void link(NxScene *ptr);
251 NxControllerManager *_cm;
271 static void init_type() {
272 PhysxObject::init_type();
273 register_type(_type_handle,
"PhysxScene",
274 PhysxObject::get_class_type());
277 return get_class_type();
281 return get_class_type();
288 #include "physxScene.I"
290 #endif // PHYSXSCENE_H
Objects of this class are returned by the 'overlap shape' methods, for example overlapSphereShapes.
Descriptor class for materials.
Abstract base class for the different types of joints.
Abstract base class for shapes.
This is a three-component vector distance (as opposed to a three-component point, which represents a ...
Descriptor for PhysxCloth.
Abstract base class for joint descriptors.
This is a three-component point in space (as opposed to a three-component vector, which represents a ...
A scene is a collection of bodies, constraints, and effectors which can interact. ...
Descriptor class for force fields.
A class for describing a shape's surface properties.
Descriptor class for a character controller.
This structure captures results for a single raycast query.
A lightweight class that represents a single element that may be timed and/or counted via stats...
Abstract base class for character controllers.
Descriptor for PhysxSoftBody.
This class exists just to provide scoping for the enums shared by PhysX classes.
static PhysxMask all_on()
Returns a PhysxMask whose bits are all on.
Descriptor for PhysxActor.
Actors are the main simulation objects.
This is a generic object that can be assigned to a callback at various points in the rendering proces...
Implementation of the NxUserControllerHitReport interface.
TypeHandle is the identifier used to differentiate C++ class types.
Implementation of the NxUserTriggerReport interface.
Objects of this class are returned by the 'raycast all' methods.
Represents an ray as an origin and direction.
Renderable geometry which represents visualizations of physics objects.
Expresses the dominance relationship of a constraint.