32class EXPCL_PANDAPHYSX PhysxCloth :
public PhysxObject,
public PhysxEnums {
45 void set_flag(PhysxClothFlag flag,
bool value);
52 bool get_flag(PhysxClothFlag flag)
const;
70 void wake_up(
float wakeCounterValue=NX_SLEEP_INTERVAL);
83 PhysxForceMode mode=FM_force);
85 PhysxForceMode mode=FM_force);
87 PhysxForceMode mode=FM_force);
89 INLINE
void ls()
const;
90 INLINE
void ls(std::ostream &out,
int indent_level=0)
const;
99 INLINE NxCloth *ptr()
const {
return _ptr; };
101 void link(NxCloth *ptr);
113 static void init_type() {
114 PhysxObject::init_type();
116 PhysxObject::get_class_type());
119 return get_class_type();
123 return get_class_type();
Renderable geometry which represents a cloth mesh.
void set_wind_acceleration(LVector3f const &acceleration)
Sets an acceleration acting normal to the cloth surface at each vertex.
void put_to_sleep()
Forces the cloth to sleep.
float get_thickness() const
Gets the cloth thickness.
float get_relative_grid_spacing() const
Gets the relative grid spacing for the broad phase.
LVector3f get_external_acceleration() const
Retrieves the external acceleration which affects all non attached particles of the cloth.
void attach_vertex_to_global_pos(unsigned int vertexId, LPoint3f const &pos)
Attaches a cloth vertex to a position in world space.
LVector3f get_wind_acceleration() const
Retrieves the acceleration acting normal to the cloth surface at each vertex.
void detach_from_shape(PhysxShape *shape)
Detaches the cloth from a shape it has been attached to before.
void add_force_at_vertex(LVector3f const &force, int vertexId, PhysxForceMode mode=FM_force)
Applies a force (or impulse) defined in the global coordinate frame, to a particular vertex of the cl...
void set_group(unsigned int group)
Sets which collision group this cloth is part of.
void attach_vertex_to_shape(unsigned int vertexId, PhysxShape *shape, LPoint3f const &localPos)
Attaches a cloth vertex to a local position within a shape.
void add_force_at_pos(LPoint3f const &pos, float magnitude, float radius, PhysxForceMode mode=FM_force)
Applies a radial force (or impulse) at a particular position.
void add_directed_force_at_pos(LPoint3f const &pos, LVector3f const &force, float radius, PhysxForceMode mode=FM_force)
Applies a directed force (or impulse) at a particular position.
void set_external_acceleration(LVector3f const &acceleration)
Sets an external acceleration which affects all non attached particles of the cloth.
void set_sleep_linear_velocity(float threshold)
Sets the linear velocity below which an cloth may go to sleep.
const char * get_name() const
Retrieves the name string.
void set_groups_mask(const PhysxGroupsMask &mask)
Sets 128-bit mask used for collision filtering.
void set_flag(PhysxClothFlag flag, bool value)
Sets the value of a single flag.
float get_sleep_linear_velocity() const
Returns the linear velocity below which an soft body may go to sleep.
PhysxVertexAttachmentStatus get_vertex_attachment_status(unsigned int vertexId) const
Return the attachment status of the given vertex.
unsigned int get_num_particles()
Gets the number of cloth particles.
void wake_up(float wakeCounterValue=NX_SLEEP_INTERVAL)
Wakes up the cloth if it is sleeping.
void attach_to_shape(PhysxShape *shape)
Attaches the cloth to a shape.
LPoint3f get_vertex_attachment_pos(unsigned int vertexId) const
Returns the attachment position of the given vertex.
float get_density() const
Gets the cloth density.
void attach_to_colliding_shapes()
Attaches the cloth to all shapes, currently colliding.
PhysxGroupsMask get_groups_mask() const
Gets the 128-bit groups mask used for collision filtering.
void set_thickness(float thickness)
Sets the cloth thickness (must be positive).
bool get_flag(PhysxClothFlag flag) const
Retrieves the value of a single flag.
PhysxShape * get_vertex_attachment_shape(unsigned int vertexId) const
Returns the pointer to an attached shape pointer of the given vertex.
unsigned int get_group() const
Retrieves the collision group this cloth is part of.
void set_name(const char *name)
Sets a name string for the object that can be retrieved with get_name().
bool is_sleeping() const
Returns true if this cloth is sleeping.
PhysxScene * get_scene() const
Returns the scene which this cloth belongs to.
void free_vertex(unsigned int vertexId)
Frees a previously attached cloth point.
This class exists just to provide scoping for the enums shared by PhysX classes.
A scene is a collection of bodies, constraints, and effectors which can interact.
Abstract base class for shapes.
TypeHandle is the identifier used to differentiate C++ class types.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
void register_type(TypeHandle &type_handle, const std::string &name)
This inline function is just a convenient way to call TypeRegistry::register_type(),...