class MAGES::MeshDeformations::SimpleParticleGrabber¶
Overview¶
A simple particle grabbing tool. More…
class SimpleParticleGrabber: public MonoBehaviour
{
public:
// structs
struct GrabbedParticleInfo;
// properties
PhysicsWorld PhysicsWorld;
float GrabRadius;
GrabType GrabType;
bool MoveToCenter;
bool GrabKinematicParticles;
int GrabLayer;
UnityEvent OnGrab;
UnityEvent OnRelease;
List ObservedParticles;
// methods
void Grab();
void Release();
};
Detailed Documentation¶
A simple particle grabbing tool.
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.
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.
ListObservedParticles
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.