Physics Revolute Joint
Updated
Hinge joint, like a door.
- Type
comp-physics-revolute-joint- Script class
PhysicsRevoluteJointComponent- Per entity
- One
- Version
- 2.0.0
Read about it in Joints: what it does, how to use it from a script, and examples.
Properties
Section titled “Properties”The props the runtime declares for this component, with their defaults and accepted ranges.
| Prop | Default | Range |
|---|---|---|
axis.x |
||
axis.y |
||
axis.z |
||
pivot |
||
pivot.x |
- |
|
pivot.y |
- |
|
pivot.z |
- |
Live example
Section titled “Live example”Run it in the browser, read its scripts, and download it as an XR Creator project.
Live example
A door that slams in the windA door panel hangs on a Revolute Joint with a vertical hinge axis. Each press of Wind gust turns it with a torque impulse about the hinge: a shut door blows open, an open one slams shut against its stop.
Press Wind gust to blow the door open, then press it again to slam it shut. Drag to orbit the camera, scroll to zoom.
From a script
Section titled “From a script”#pragma lifecycle(startup)
function startup() { const component = self.parent.getComponent(PhysicsRevoluteJointComponent); if (component) log(component.props);}