Physics
Work with forces, collisions, mass, and physical properties.
Feature: Physics
What do you want to do?
llApplyImpulse(vector momentum, integer is_local)Applies a linear impulse (momentum) to a physical object. If local is TRUE, the impulse is applied in local coordinates; otherwise, it is applied in global region coordinates.llSetForce(vector force, integer is_local)Applies a constant linear force to a physical object. If local is TRUE, force is applied relative to local coordinates; if FALSE, applied relative to region coordinates.list llGetPhysicsMaterial()Returns a list of the format [float gravity_multiplier, float restitution, float friction, float density] detailing the physical characteristics of the object.list llCastRay(vector start_pos, vector end_pos, list options)Casts a ray into the physics world from start to end and reports collision data for intersections with objects based on options. Returns a list of strided values [UUID_1, {link_number_1}, hit_position_1, {hit_normal_1}, ..., status_code]. A negative status_code indicates an error; otherwise, it represents the number of hits.Reference
47 topic entries
llApplyImpulse(vector momentum, integer is_local)functionApplies a linear impulse (momentum) to a physical object. If local is
TRUE, the impulse is applied in local coordinates; otherwise, it is applied in global region coordinates.llApplyRotationalImpulse(vector force, integer is_local)functionApplies a rotational impulse (force) to a physical object. If local is
TRUE, the rotational impulse is applied in local coordinates; otherwise, it is applied in global region coordinates.list llCastRay(vector start_pos, vector end_pos, list options)functionCasts a ray into the physics world from start to end and reports collision data for intersections with objects based on options. Returns a list of strided values [UUID_1, {link_number_1}, hit_position_1, {hit_normal_1}, ..., status_code]. A negative status_code indicates an error; otherwise, it represents the number of hits.
llCollisionFilter(string name, key id, integer accept)functionSets the collision filter, either exclusively or inclusively. If accept is
TRUE, only collisions matching name and id are processed; ifFALSE, matches are excluded. Pass an empty string orNULL_KEYto name or id to skip filtering on that parameter.llCollisionSound(string impact_sound, float impact_volume)functionSuppresses default collision sounds and replaces default impact sounds with impact_sound at the volume level specified by impact_volume. Supply an empty string to only suppress collision sounds.
vector llGetAccel()functionReturns a vector representing the acceleration of the object in the region's frame of reference.
vector llGetCenterOfMass()functionReturns the vector position (in region coordinates) of the center of mass. Returns the individual child prim's center of mass if called from a child, or the entire linkset's center of mass if called from the root.
vector llGetForce()functionReturns a vector representing the constant force currently applied to the object (if the object is physical).
vector llGetGeometricCenter()functionReturns a vector representing the geometric center of the object relative to its root prim.
float llGetMass()functionReturns a float representing the mass of the object (in lindograms). Returns the total linkset mass if called from the root, or the individual prim's mass if called from a child prim. Returns the wearer's mass if inside an attachment.
float llGetMassMKS()functionReturns a float representing the mass of the object in kilograms. Functionally identical to
llGetMassexcept for using MKS (metric) units.float llGetObjectMass(key id)functionReturns a float representing the mass of the avatar or object specified by id.
vector llGetOmega()functionReturns a vector representing the physical rotation (angular velocity) of the object in radians per second.
list llGetPhysicsMaterial()functionReturns a list of the format
[float gravity_multiplier, float restitution, float friction, float density]detailing the physical characteristics of the object.integer llGetStatus(integer status)functionReturns a boolean integer indicating whether the specified status flag status is enabled for the object.
vector llGetTorque()functionReturns a vector representing the physical torque force currently acting on the object (if the object is physical).
vector llGetVel()functionReturns a vector representing the velocity of the object (in meters per second) relative to the global region coordinates. For physical objects, returns the velocity of its center of mass.
llLookAt(vector target, float strength, float damping)functionCauses the object to orient its positive Z-axis (up axis) toward the target vector, keeping its positive X-axis (forward axis) below the horizon. Tracks target until
llStopLookAtis called or strength is set to 0.0.llMoveToTarget(vector target, float tau)functionCritically damps the physical object's motion to position target in tau seconds. Setting tau to 0.0 stops the critical damping; recommended tau values are greater than 0.2.
llPassCollisions(integer pass)functionSets the pass-collisions attribute. If pass is
TRUE, collision events are passed from child prims to the root; ifFALSE(default), they only trigger events in the affected child prim.llPushObject(key target, vector impulse, vector ang_impulse, integer is_local)functionApplies physical impulse (force) and ang_impulse (rotational force) to the specified target avatar or object.
llRemoveVehicleFlags(integer flags)functionDisables the specified vehicle flags (sets them to
FALSE) using the bitwise mask flags.llRotLookAt(rotation target_direction, float strength, float damping)functionCauses the object to smoothly rotate to target_direction with a force defined by strength and damping. A strength of 0.0 cancels the rotation target. Rotation is maintained until stopped with
llStopLookAt.integer llRotTarget(rotation rot, float error)functionRegisters the rotation rot with a leeway tolerance error (in radians) as a target, triggering
at_rot_targetandnot_at_rot_targetevents. Returns an integer handle to unregister the target viallRotTargetRemove.llRotTargetRemove(integer handle)functionRemoves the rotational target specified by the integer handle registered with
llRotTarget.llSetAgentRot(rotation rot, integer flags)functionSets the rotation of the avatar to rot, controlled by flags.
llSetAngularVelocity(vector initial_omega, integer is_local)functionSets the angular velocity of a physical object to initial_omega (mass-independent). If local is
TRUE, applied in local coordinates; ifFALSE, applied in global coordinates. Has no effect on non-physical objects.llSetBuoyancy(float buoyancy)functionSets the buoyancy of a physical object (requires physics to be enabled). A value of 0.0 offers no buoyancy, < 1.0 sinks, 1.0 counteracts gravity, and > 1.0 rises.
llSetForce(vector force, integer is_local)functionApplies a constant linear force to a physical object. If local is
TRUE, force is applied relative to local coordinates; ifFALSE, applied relative to region coordinates.llSetForceAndTorque(vector force, vector torque, integer is_local)functionSets both the constant linear force and constant torque acting on a physical object. If local is
TRUE, forces are applied in local coordinates; ifFALSE, in global coordinates.llSetHoverHeight(float height, integer water, float tau)functionCritically damps the physical object's vertical movement to hover at height (above ground, or above water if water is
TRUE) in tau seconds. Do not use with vehicles; callllStopHoverto cancel.llSetKeyframedMotion(list keyframes, list options)functionSmoothly moves a non-physical object between the positions, orientations, and times specified in the keyframes list, configured via options. Collisions with keyframed objects are ignored. An empty keyframes list terminates the motion.
llSetPhysicsMaterial(integer mask, float gravity_multiplier, float restitution, float friction, float density)functionConfigures the physical characteristics of an object. The mask bitfield specifies which of the other parameters (gravity_multiplier, restitution, friction, or density) should be applied to the object.
llSetStatus(integer status, integer value)functionSets the object status attributes specified by status to value.
llSetTorque(vector torque, integer is_local)functionApplies a constant torque rotational force to a physical object. If local is
TRUE, torque is applied in local coordinates; ifFALSE, applied in global coordinates.llSetVelocity(vector velocity, integer is_local)functionSets the linear velocity of a physical object to velocity. If local is
TRUE, velocity is treated as a local directional vector; ifFALSE, as a global region directional vector. Has no effect on non-physical objects.llStopHover()functionStops the hover behavior (such as that initiated by
llSetHoverHeight).llStopLookAt()functionStops causing the object to look at or point toward a target (canceling
llLookAtorllRotLookAt).llStopMoveToTarget()functionStops the critically damped movement of the object toward a target (canceling
llMoveToTarget). UsellStopLookAtto stop rotational tracking.llTargetOmega(vector axis, float spinrate, float gain)functionApplies a smooth client-side rotation around the local axis at a rate equal to spinrate multiplied by the magnitude of axis (in radians per second) with a force defined by gain. Set spinrate to 0.0 to cancel.
llVolumeDetect(integer detect)functionIf detect is
TRUE, enables VolumeDetect (object becomes phantom and physical objects/avatars can pass through it). Triggerscollision_starton initial intersection andcollision_endwhen intersection stops (standard collision events are suppressed while intersecting).collision_start(integer num_detected)eventTriggered when an avatar or another object first begins colliding with the object containing the script. Passes num_detected, representing the number of detected collisions.
collision(integer num_detected)eventTriggered continuously while an avatar or another object is colliding with the object containing the script. Passes num_detected, representing the number of detected collisions.
collision_end(integer num_detected)eventTriggered when an avatar or another object stops colliding with the object containing the script. Passes num_detected, representing the number of detected collisions.
land_collision_start(vector pos)eventTriggered in the root prim when a physical object or attached avatar first begins colliding with the ground at position pos.
land_collision(vector pos)eventTriggered in the root prim when a physical object or attached avatar is colliding with the ground at position pos.
land_collision_end(vector pos)eventTriggered in the root prim when a physical object or attached avatar stops colliding with the ground at position pos.
No matching entries. Try a different term or filter.