Panda3D
|
Public Member Functions | |
PhysxSoftBodyNode * | create_soft_body_node (const char *name) |
virtual TypeHandle | force_init_type () |
float | get_attachment_tear_factor () const |
Retrieves the attachment soft body tear factor. | |
float | get_damping_coefficient () const |
Retrieves the damping coefficient. | |
float | get_density () const |
Gets the soft body density. | |
bool | get_flag (PhysxSoftBodyFlag flag) const |
Retrieves the value of a single flag. | |
float | get_friction () const |
Retrieves the soft body friction coefficient. | |
unsigned int | get_group () const |
Retrieves the collision group this soft body is part of. | |
PhysxGroupsMask | get_groups_mask () const |
Gets the 128-bit groups mask used for collision filtering. | |
const char * | get_name () const |
Retrieves the name string. | |
unsigned int | get_num_particles () |
Gets the number of cloth particles. | |
float | get_particle_radius () const |
Gets the soft body particle radius. | |
float | get_relative_grid_spacing () const |
Gets the relative grid spacing for the broad phase. | |
PhysxScene * | get_scene () const |
Returns the scene which this soft body belongs to. | |
float | get_sleep_linear_velocity () const |
Returns the linear velocity below which an soft body may go to sleep. | |
PhysxSoftBodyNode * | get_soft_body_node () const |
unsigned int | get_solver_iterations () const |
Retrieves the soft body solver iterations. | |
float | get_stretching_stiffness () const |
Retrieves the soft body stretching stiffness. | |
float | get_tear_factor () const |
Retrieves the soft body tear factor. | |
virtual TypeHandle | get_type () const |
float | get_volume_stiffness () const |
Retrieves the soft body volume stiffness. | |
bool | is_sleeping () const |
Returns true if this soft body is sleeping. | |
void | link (NxSoftBody *ptr) |
void | ls () const |
void | ls (ostream &out, int indent_level=0) const |
NxSoftBody * | ptr () const |
void | put_to_sleep () |
Forces the soft body to sleep. | |
void | release () |
void | set_attachment_tear_factor (float factor) |
Sets the soft body attachment tear factor (must be larger than one). | |
void | set_damping_coefficient (float coef) |
Sets the damping coefficient in the range from 0 to 1. | |
void | set_flag (PhysxSoftBodyFlag flag, bool value) |
Sets the value of a single flag. | |
void | set_friction (float friction) |
Sets the soft body friction coefficient in the range from 0 to 1. | |
void | set_group (unsigned int group) |
Sets which collision group this soft body is part of. | |
void | set_groups_mask (const PhysxGroupsMask &mask) |
Sets 128-bit mask used for collision filtering. | |
void | set_name (const char *name) |
Sets a name string for the object that can be retrieved with get_name(). | |
void | set_particle_radius (float radius) |
Sets the soft body particle radius (must be positive). | |
void | set_sleep_linear_velocity (float threshold) |
Sets the linear velocity below which an soft body may go to sleep. | |
void | set_solver_iterations (unsigned int iterations) |
Sets the soft body solver iterations. | |
void | set_stretching_stiffness (float stiffness) |
Sets the soft body stretching stiffness in the range from 0 to 1. | |
void | set_tear_factor (float factor) |
Sets the soft body tear factor (must be larger than one). | |
void | set_volume_stiffness (float stiffness) |
Sets the soft body volume stiffness in the range from 0 to 1. | |
void | unlink () |
void | update () |
void | wake_up (float wakeCounterValue=NX_SLEEP_INTERVAL) |
Wakes up the soft body if it is sleeping. | |
Static Public Member Functions | |
static TypeHandle | get_class_type () |
static void | init_type () |
This function is declared non-inline to work around a compiler bug in g++ 2.96. |
Definition at line 34 of file physxSoftBody.h.
float PhysxSoftBody::get_attachment_tear_factor | ( | ) | const |
Retrieves the attachment soft body tear factor.
Definition at line 476 of file physxSoftBody.cxx.
float PhysxSoftBody::get_damping_coefficient | ( | ) | const |
Retrieves the damping coefficient.
Definition at line 399 of file physxSoftBody.cxx.
float PhysxSoftBody::get_density | ( | ) | const |
Gets the soft body density.
Definition at line 307 of file physxSoftBody.cxx.
bool PhysxSoftBody::get_flag | ( | PhysxSoftBodyFlag | flag | ) | const |
Retrieves the value of a single flag.
Definition at line 294 of file physxSoftBody.cxx.
float PhysxSoftBody::get_friction | ( | ) | const |
Retrieves the soft body friction coefficient.
Definition at line 424 of file physxSoftBody.cxx.
unsigned int PhysxSoftBody::get_group | ( | ) | const |
Retrieves the collision group this soft body is part of.
Definition at line 190 of file physxSoftBody.cxx.
PhysxGroupsMask PhysxSoftBody::get_groups_mask | ( | ) | const |
Gets the 128-bit groups mask used for collision filtering.
Definition at line 217 of file physxSoftBody.cxx.
const char * PhysxSoftBody::get_name | ( | ) | const |
Retrieves the name string.
Definition at line 163 of file physxSoftBody.cxx.
unsigned int PhysxSoftBody::get_num_particles | ( | ) |
Gets the number of cloth particles.
Definition at line 235 of file physxSoftBody.cxx.
float PhysxSoftBody::get_particle_radius | ( | ) | const |
Gets the soft body particle radius.
Definition at line 260 of file physxSoftBody.cxx.
float PhysxSoftBody::get_relative_grid_spacing | ( | ) | const |
Gets the relative grid spacing for the broad phase.
The cloth is represented by a set of world aligned cubical cells in broad phase. The size of these cells is determined by multiplying the length of the diagonal of the AABB of the initial soft body size with this constant.
Definition at line 324 of file physxSoftBody.cxx.
PhysxScene * PhysxSoftBody::get_scene | ( | ) | const |
Returns the scene which this soft body belongs to.
Definition at line 106 of file physxSoftBody.cxx.
float PhysxSoftBody::get_sleep_linear_velocity | ( | ) | const |
Returns the linear velocity below which an soft body may go to sleep.
Soft bodies whose linear velocity is above this threshold will not be put to sleep.
Definition at line 588 of file physxSoftBody.cxx.
unsigned int PhysxSoftBody::get_solver_iterations | ( | ) | const |
Retrieves the soft body solver iterations.
Definition at line 500 of file physxSoftBody.cxx.
float PhysxSoftBody::get_stretching_stiffness | ( | ) | const |
Retrieves the soft body stretching stiffness.
Definition at line 374 of file physxSoftBody.cxx.
float PhysxSoftBody::get_tear_factor | ( | ) | const |
Retrieves the soft body tear factor.
Definition at line 450 of file physxSoftBody.cxx.
float PhysxSoftBody::get_volume_stiffness | ( | ) | const |
Retrieves the soft body volume stiffness.
Definition at line 349 of file physxSoftBody.cxx.
static void PhysxSoftBody::init_type | ( | ) | [inline, static] |
This function is declared non-inline to work around a compiler bug in g++ 2.96.
Making it inline seems to cause problems in the optimizer.
Reimplemented from PhysxObject.
Definition at line 198 of file physxSoftBody.h.
References PhysxObject::init_type().
bool PhysxSoftBody::is_sleeping | ( | ) | const |
Returns true if this soft body is sleeping.
When a soft body does not move for a period of time, it is no longer simulated in order to save time. This state is called sleeping. However, because the object automatically wakes up when it is either touched by an awake object, or one of its properties is changed by the user, the entire sleep mechanism should be transparent to the user.
Definition at line 520 of file physxSoftBody.cxx.
void PhysxSoftBody::put_to_sleep | ( | ) |
Forces the soft body to sleep.
The soft body will stay asleep until the next call to simulate, and will not wake up until then even when otherwise it would (for example a force is applied to it). It can however wake up during the next do_physics call.
Definition at line 555 of file physxSoftBody.cxx.
void PhysxSoftBody::set_attachment_tear_factor | ( | float | factor | ) |
Sets the soft body attachment tear factor (must be larger than one).
Definition at line 463 of file physxSoftBody.cxx.
void PhysxSoftBody::set_damping_coefficient | ( | float | coef | ) |
Sets the damping coefficient in the range from 0 to 1.
Definition at line 387 of file physxSoftBody.cxx.
void PhysxSoftBody::set_flag | ( | PhysxSoftBodyFlag | flag, |
bool | value | ||
) |
Sets the value of a single flag.
Definition at line 272 of file physxSoftBody.cxx.
void PhysxSoftBody::set_friction | ( | float | friction | ) |
Sets the soft body friction coefficient in the range from 0 to 1.
Definition at line 412 of file physxSoftBody.cxx.
void PhysxSoftBody::set_group | ( | unsigned int | group | ) |
Sets which collision group this soft body is part of.
Collision group must be between 0 and 31.
Definition at line 176 of file physxSoftBody.cxx.
void PhysxSoftBody::set_groups_mask | ( | const PhysxGroupsMask & | mask | ) |
Sets 128-bit mask used for collision filtering.
Definition at line 202 of file physxSoftBody.cxx.
void PhysxSoftBody::set_name | ( | const char * | name | ) |
Sets a name string for the object that can be retrieved with get_name().
This is for debugging and is not used by the engine.
Definition at line 149 of file physxSoftBody.cxx.
void PhysxSoftBody::set_particle_radius | ( | float | radius | ) |
Sets the soft body particle radius (must be positive).
Definition at line 248 of file physxSoftBody.cxx.
void PhysxSoftBody::set_sleep_linear_velocity | ( | float | threshold | ) |
Sets the linear velocity below which an soft body may go to sleep.
SoftBodys whose linear velocity is above this threshold will not be put to sleep.
Setting the sleep angular/linear velocity only makes sense when the BF_energy_sleep_test is not set.
Definition at line 573 of file physxSoftBody.cxx.
void PhysxSoftBody::set_solver_iterations | ( | unsigned int | iterations | ) |
Sets the soft body solver iterations.
Definition at line 488 of file physxSoftBody.cxx.
void PhysxSoftBody::set_stretching_stiffness | ( | float | stiffness | ) |
Sets the soft body stretching stiffness in the range from 0 to 1.
Definition at line 362 of file physxSoftBody.cxx.
void PhysxSoftBody::set_tear_factor | ( | float | factor | ) |
Sets the soft body tear factor (must be larger than one).
Definition at line 437 of file physxSoftBody.cxx.
void PhysxSoftBody::set_volume_stiffness | ( | float | stiffness | ) |
Sets the soft body volume stiffness in the range from 0 to 1.
Definition at line 337 of file physxSoftBody.cxx.
void PhysxSoftBody::wake_up | ( | float | wakeCounterValue = NX_SLEEP_INTERVAL | ) |
Wakes up the soft body if it is sleeping.
The wakeCounterValue determines how long until the body is put to sleep, a value of zero means that the body is sleeping. wake_up(0) is equivalent to PhysxSoftBody::put_to_sleep().
Definition at line 537 of file physxSoftBody.cxx.