[package]
name = "Physics"
description = "Physics functionality and state."
content = { type = "Asset", schema = true }
version = "0.3.1"
ambient_version = "0.3.1"
[components.angular_velocity]
type = "Vec3"
name = "Angular velocity"
description = """
Angular velocity (radians/second) of this entity in the physics scene.
Updating this component will update the entity's angular velocity in the physics scene.
Note that changing this component will forcibly set the velocity; changing the velocity every frame may lead to unexpected behavior, like improper physics or collisions failing.
If you need to adjust the velocity each frame, consider applying an impulse using `physics` functions instead."""
attributes = ["Debuggable", "Networked", "Store"]
[components.cube_collider]
type = "Vec3"
name = "Cube collider"
description = """
If attached, this entity will have a cube physics collider.
`x, y, z` is the size of the cube."""
attributes = ["Debuggable", "Networked", "Store"]
[components.character_controller_height]
type = "F32"
name = "Character controller height"
description = """
The height of the physics character controller attached to this entity.
If an entity has both this and a `character_controller_radius`, it will be given a physical character collider."""
attributes = ["Debuggable", "Networked", "Store"]
[components.character_controller_radius]
type = "F32"
name = "Character controller radius"
description = """
The radius of the physics character controller attached to this entity.
If an entity has both this and a `character_controller_height`, it will be given a physical character collider."""
attributes = ["Debuggable", "Networked", "Store"]
[components.collider_from_url]
type = "String"
name = "Collider from URL"
description = """
This entity will load its physics collider from the URL.
The value is the URL to load from."""
attributes = ["Debuggable", "Networked", "Store"]
[components.collider_loaded]
type = "Empty"
name = "Collider loaded"
description = """
This component is automatically attached to an entity once the collider has been loaded (through e.g. `collider_from_url`)."""
attributes = ["Debuggable", "Networked", "Store"]
[components.collider_loads]
type = { type = "Vec", element_type = "EntityId" }
name = "Collider loads"
description = "Contains all colliders that were loaded in this physics tick."
attributes = ["Debuggable", "Networked", "Resource", "Store"]
[components.contact_offset]
type = "F32"
name = "Contact offset"
description = """
Contact offset (in meters) of this entity in the physics scene.
Updating this component will update the entity's contact offset for each attached shape in the physics scene."""
attributes = ["Debuggable", "Networked", "Store"]
[components.density]
type = "F32"
name = "Density"
description = """
The density of this entity.
This is used to update the `mass` when the entity is rescaled."""
default = 1.0
attributes = ["Debuggable", "Networked", "Store"]
[components.dynamic]
type = "Bool"
name = "Dynamic"
description = "If this is true, the entity will be dynamic (i.e. be able to move). Otherwise, it will be static."
attributes = ["Debuggable", "Networked", "Store"]
[components.kinematic]
type = "Empty"
name = "Kinematic"
description = "If attached, and this entity is dynamic, this entity will also be kinematic (i.e. unable to be affected by other entities motion). Otherwise, it will receive forces normally."
attributes = ["Debuggable", "Networked", "Store"]
[components.linear_velocity]
type = "Vec3"
name = "Linear velocity"
description = """
Linear velocity (meters/second) of this entity in the physics scene.
Updating this component will update the entity's linear velocity in the physics scene.
Note that changing this component will forcibly set the velocity; changing the velocity every frame may lead to unexpected behavior, like gravity not working or collisions failing.
If you need to adjust the velocity each frame, consider applying a force using `physics` functions instead."""
attributes = ["Debuggable", "Networked", "Store"]
[components.make_physics_static]
type = "Bool"
name = "Make physics static"
description = "All physics objects will be made static when loaded."
attributes = ["Debuggable", "Networked", "Resource", "Store"]
[components.mass]
type = "F32"
name = "Mass"
description = "The mass of this entity, measured in kilograms."
default = 1.0
attributes = ["Debuggable", "Networked", "Store"]
[components.physics_controlled]
type = "Empty"
name = "Physics controlled"
description = """
If attached, this entity will be controlled by physics.
Note that this requires the entity to have a collider."""
attributes = ["Debuggable", "Networked", "Store"]
[components.plane_collider]
type = "Empty"
name = "Plane collider"
description = "If attached, this entity will have a plane physics collider. A plane is an infinite, flat surface. If you need a bounded flat surface, consider using a cube collider instead."
attributes = ["Debuggable", "Networked", "Store"]
[components.rest_offset]
type = "F32"
name = "Rest offset"
description = """
Rest offset (in meters) of this entity in the physics scene.
Updating this component will update the entity's rest offset for each attached shape in the physics scene."""
attributes = ["Debuggable", "Networked", "Store"]
[components.sphere_collider]
type = "F32"
name = "Sphere collider"
description = """
If attached, this entity will have a sphere physics collider.
The value corresponds to the radius of the sphere."""
attributes = ["Debuggable", "Networked", "Store"]
[components.unit_mass]
type = "F32"
name = "Unit mass"
description = "The mass of a character/unit."
attributes = ["Debuggable", "Networked", "Store"]
[components.unit_velocity]
type = "Vec3"
name = "Unit velocity"
description = "The velocity of a character/unit."
attributes = ["Debuggable", "Networked", "Store"]
[components.unit_yaw]
type = "F32"
name = "Unit yaw"
description = "The yaw of a character/unit."
attributes = ["Debuggable", "Networked", "Store"]
[components.visualize_collider]
type = "Empty"
name = "Visualize collider"
description = """If attached, the collider will be rendered.
**Note**: this will continuously overwrite the `local_gizmos` component.
"""
attributes = ["Debuggable", "Networked"]
[concepts.CharacterController]
name = "Character Controller"
description = """A capsule character controller. The capsule is defined as a position, a vertical height, and a radius. The height is the distance between the two sphere centers at the end of the capsule.
**Note**: The character controller is not affected by gravity; you will have to manually simulate gravity by moving the character down in accordance with a vertical velocity you maintain. See the `character_movement` package for an example."""
[concepts.CharacterController.components.required]
character_controller_height = { suggested = 2.0 }
character_controller_radius = { suggested = 0.5 }
physics_controlled = { suggested = {} }