class MAGES::MeshDeformations::AdvancedParticleGrabber¶
Overview¶
Uses pin joints to grab particles. More…
class AdvancedParticleGrabber: public MonoBehaviour
{
public:
// structs
struct ObservedParticleGroup;
// properties
PhysicsWorld PhysicsWorld;
float GrabRadius;
GrabType GrabType;
bool MoveToCenter;
bool GrabKinematicParticles;
int GrabLayer;
float BreakForce;
UnityEvent OnGrab;
UnityEvent OnRelease;
List<ObservedParticleGroup> ObservedParticles;
// methods
void Grab();
void Release();
};
Detailed Documentation¶
Uses pin joints to grab particles.
Properties¶
PhysicsWorld PhysicsWorld
Gets or sets the physics world in which this grabber tool will operate.
float GrabRadius
Gets or sets the distance at which the grabber will grab a particle.
GrabType GrabType
Gets or sets the type of grab the grabber will perform.
bool MoveToCenter
Gets or sets a value indicating whether the grabbed particle should be moved to the center of the grabber or keep the initial offset.
bool GrabKinematicParticles
Gets or sets a value indicating whether the grabber should grab particles that are kinematic (with infinite mass).
int GrabLayer
Gets or sets the layer at which the grabber will grab particles. If set to -1, the grabber will grab all particles.
float BreakForce
Gets or sets the maximum force applied to grabbed particles before the connection is broken.
UnityEvent OnGrab
Gets or sets the event called when a grab is requested.
UnityEvent OnRelease
Gets or sets the event called when a release is requested.
List<ObservedParticleGroup> ObservedParticles
Gets or sets the observed particles that will be grabbed.
Methods¶
void Grab()
Grab the closest particle to the grabber. The grabbing will be done in the next physics update.
void Release()
Released the grabbed particles if any.