pub struct Collision {
pub entry: LvdEntry,
pub col_flags: ColFlags,
pub vertices: Vec<Vector2>,
pub normals: Vec<Vector2>,
pub cliffs: Vec<CollisionCliff>,
pub materials: Vec<CollisionMaterial>,
pub unknowns: Vec<UnknownEntry>,
}
Expand description
A single collision in the level. Includes shape, ledges, collision material, flags about the collision properties, and all other properties of the collision.
Fields§
§entry: LvdEntry
The generic object data of the collision
col_flags: ColFlags
The flags specifying certain aspects of the collision behavior (whether the collision is rigged to an animated bone, whether the platform can be dropped through, etc.)
vertices: Vec<Vector2>
The vertices describing the shape of the collision
normals: Vec<Vector2>
The collision “normals”, these are unit vectors describing the direction the collision is
solid from. It effectively points “outward”. So a normal of Vector2(0.0, 1.0)
means the
collision is solid from the top side.
cliffs: Vec<CollisionCliff>
Data describing grabbable ledges, internally called “cliffs”, present in this collision. This describes how far away the ledge can be grabbed from as well as what vertex/edge the cliff is a part of.
materials: Vec<CollisionMaterial>
For each segment in the collision, describe the “material”. For example, a slippery stage
may have a line_material
of GroundCollAttr::GROUND_COLL_ATTR_ICE
. This has no relation
to graphical materials, only physics/sounds are affected by this.
unknowns: Vec<UnknownEntry>
Trait Implementations§
Source§impl BinRead for Collision
impl BinRead for Collision
Source§fn read_options<R: Read + Seek>(
__binrw_generated_var_reader: &mut R,
__binrw_generated_var_options: &ReadOptions,
__binrw_generated_var_arguments: Self::Args,
) -> BinResult<Self>
fn read_options<R: Read + Seek>( __binrw_generated_var_reader: &mut R, __binrw_generated_var_options: &ReadOptions, __binrw_generated_var_arguments: Self::Args, ) -> BinResult<Self>
Self
from the reader using the given ReadOptions
and
arguments.Source§fn read<R>(reader: &mut R) -> Result<Self, Error>
fn read<R>(reader: &mut R) -> Result<Self, Error>
Self
from the reader using default arguments.