Physics
Work with forces, collisions, mass, and physical properties.
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
Kind
llApplyImpulse(vector momentum, integer is_local)Applies a linear impulse (momentum) to a physical object. If local isTRUE, the impulse is applied in local coordinates; otherwise, it is applied in global region coordinates.functionllApplyRotationalImpulse(vector force, integer is_local)Applies a rotational impulse (force) to a physical object. If local isTRUE, the rotational impulse is applied in local coordinates; otherwise, it is applied in global region coordinates.functionlist 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.functionllCollisionFilter(string name, key id, integer accept)Sets the collision filter, either exclusively or inclusively. If accept isTRUE, 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.functionllCollisionSound(string impact_sound, float impact_volume)Suppresses 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.functionvector llGetAccel()Returns a vector representing the acceleration of the object in the region's frame of reference.functionvector llGetCenterOfMass()Returns 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.functionvector llGetForce()Returns a vector representing the constant force currently applied to the object (if the object is physical).functionvector llGetGeometricCenter()Returns a vector representing the geometric center of the object relative to its root prim.functionfloat llGetMass()Returns 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.functionfloat llGetMassMKS()Returns a float representing the mass of the object in kilograms. Functionally identical tollGetMassexcept for using MKS (metric) units.functionfloat llGetObjectMass(key id)Returns a float representing the mass of the avatar or object specified by id.functionvector llGetOmega()Returns a vector representing the physical rotation (angular velocity) of the object in radians per second.functionlist llGetPhysicsMaterial()Returns a list of the format[float gravity_multiplier, float restitution, float friction, float density]detailing the physical characteristics of the object.functioninteger llGetStatus(integer status)Returns a boolean integer indicating whether the specified status flag status is enabled for the object.functionvector llGetTorque()Returns a vector representing the physical torque force currently acting on the object (if the object is physical).functionvector llGetVel()Returns 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.functionllLookAt(vector target, float strength, float damping)Causes 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 untilllStopLookAtis called or strength is set to 0.0.functionllMoveToTarget(vector target, float tau)Critically 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.functionllPassCollisions(integer pass)Sets the pass-collisions attribute. If pass isTRUE, collision events are passed from child prims to the root; ifFALSE(default), they only trigger events in the affected child prim.functionllPushObject(key target, vector impulse, vector ang_impulse, integer is_local)Applies physical impulse (force) and ang_impulse (rotational force) to the specified target avatar or object.functionllRemoveVehicleFlags(integer flags)Disables the specified vehicle flags (sets them toFALSE) using the bitwise mask flags.functionllRotLookAt(rotation target_direction, float strength, float damping)Causes 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 withllStopLookAt.functioninteger llRotTarget(rotation rot, float error)Registers the rotation rot with a leeway tolerance error (in radians) as a target, triggeringat_rot_targetandnot_at_rot_targetevents. Returns an integer handle to unregister the target viallRotTargetRemove.functionllRotTargetRemove(integer handle)Removes the rotational target specified by the integer handle registered withllRotTarget.functionllSetAgentRot(rotation rot, integer flags)Sets the rotation of the avatar to rot, controlled by flags.functionllSetAngularVelocity(vector initial_omega, integer is_local)Sets the angular velocity of a physical object to initial_omega (mass-independent). If local isTRUE, applied in local coordinates; ifFALSE, applied in global coordinates. Has no effect on non-physical objects.functionllSetBuoyancy(float buoyancy)Sets 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.functionllSetForce(vector force, integer is_local)Applies a constant linear force to a physical object. If local isTRUE, force is applied relative to local coordinates; ifFALSE, applied relative to region coordinates.functionllSetForceAndTorque(vector force, vector torque, integer is_local)Sets both the constant linear force and constant torque acting on a physical object. If local isTRUE, forces are applied in local coordinates; ifFALSE, in global coordinates.functionllSetHoverHeight(float height, integer water, float tau)Critically damps the physical object's vertical movement to hover at height (above ground, or above water if water isTRUE) in tau seconds. Do not use with vehicles; callllStopHoverto cancel.functionllSetKeyframedMotion(list keyframes, list options)Smoothly 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.functionllSetPhysicsMaterial(integer mask, float gravity_multiplier, float restitution, float friction, float density)Configures 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.functionllSetStatus(integer status, integer value)Sets the object status attributes specified by status to value.functionllSetTorque(vector torque, integer is_local)Applies a constant torque rotational force to a physical object. If local isTRUE, torque is applied in local coordinates; ifFALSE, applied in global coordinates.functionllSetVelocity(vector velocity, integer is_local)Sets the linear velocity of a physical object to velocity. If local isTRUE, velocity is treated as a local directional vector; ifFALSE, as a global region directional vector. Has no effect on non-physical objects.functionllStopHover()Stops the hover behavior (such as that initiated byllSetHoverHeight).functionllStopLookAt()Stops causing the object to look at or point toward a target (cancelingllLookAtorllRotLookAt).functionllStopMoveToTarget()Stops the critically damped movement of the object toward a target (cancelingllMoveToTarget). UsellStopLookAtto stop rotational tracking.functionllTargetOmega(vector axis, float spinrate, float gain)Applies 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.functionllVolumeDetect(integer detect)If detect isTRUE, 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).functioncollision_start(integer num_detected)Triggered when an avatar or another object first begins colliding with the object containing the script. Passes num_detected, representing the number of detected collisions.eventcollision(integer num_detected)Triggered continuously while an avatar or another object is colliding with the object containing the script. Passes num_detected, representing the number of detected collisions.eventcollision_end(integer num_detected)Triggered when an avatar or another object stops colliding with the object containing the script. Passes num_detected, representing the number of detected collisions.eventland_collision_start(vector pos)Triggered in the root prim when a physical object or attached avatar first begins colliding with the ground at position pos.eventland_collision(vector pos)Triggered in the root prim when a physical object or attached avatar is colliding with the ground at position pos.eventland_collision_end(vector pos)Triggered in the root prim when a physical object or attached avatar stops colliding with the ground at position pos.event
No matching entries. Try a different term or filter.