[−][src]Struct specs_physics::collider::PhysicsColliderBuilder
The PhysicsColliderBuilder
implements the builder pattern for
PhysicsCollider
s and is the recommended way of instantiating and
customising new PhysicsCollider
instances.
Example
use specs_physics::{ collider::{ material::{BasicMaterial, MaterialHandle}, CollisionGroups, }, math::Isometry3, PhysicsColliderBuilder, Shape, }; let physics_collider = PhysicsColliderBuilder::from(Shape::Rectangle(10.0, 10.0, 1.0)) .offset_from_parent(Isometry3::identity()) .density(1.2) .material(MaterialHandle::new(BasicMaterial::default())) .margin(0.02) .collision_groups(CollisionGroups::default()) .linear_prediction(0.001) .angular_prediction(0.0) .sensor(true) .build();
Methods
impl<N: RealField> PhysicsColliderBuilder<N>
[src]
pub fn offset_from_parent(self, offset_from_parent: Isometry3<N>) -> Self
[src]
Sets the offset_from_parent
value of the PhysicsColliderBuilder
.
pub fn density(self, density: N) -> Self
[src]
Sets the density
value of the PhysicsColliderBuilder
.
pub fn material(self, material: MaterialHandle<N>) -> Self
[src]
Sets the material
value of the PhysicsColliderBuilder
.
pub fn margin(self, margin: N) -> Self
[src]
Sets the margin
value of the PhysicsColliderBuilder
.
pub fn collision_groups(self, collision_groups: CollisionGroups) -> Self
[src]
Sets the collision_groups
value of the PhysicsColliderBuilder
.
pub fn linear_prediction(self, linear_prediction: N) -> Self
[src]
Sets the linear_prediction
value of the PhysicsColliderBuilder
.
pub fn angular_prediction(self, angular_prediction: N) -> Self
[src]
Sets the angular_prediction
value of the PhysicsColliderBuilder
.
pub fn sensor(self, sensor: bool) -> Self
[src]
Sets the sensor
value of the PhysicsColliderBuilder
.
pub fn build(self) -> PhysicsCollider<N>
[src]
Builds the PhysicsCollider
from the values set in the
PhysicsColliderBuilder
instance.
Trait Implementations
impl<N: RealField> From<Shape<N>> for PhysicsColliderBuilder<N>
[src]
Auto Trait Implementations
impl<N> Send for PhysicsColliderBuilder<N> where
N: Scalar,
N: Scalar,
impl<N> Sync for PhysicsColliderBuilder<N> where
N: Scalar,
N: Scalar,
Blanket Implementations
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From<T> for T
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<SS, SP> SupersetOf<SS> for SP where
SS: SubsetOf<SP>,
SS: SubsetOf<SP>,
fn to_subset(&self) -> Option<SS>
fn is_in_subset(&self) -> bool
unsafe fn to_subset_unchecked(&self) -> SS
fn from_subset(element: &SS) -> SP
impl<T> Downcast for T where
T: Any,
T: Any,
fn into_any(self: Box<T>) -> Box<dyn Any + 'static>
fn as_any(&self) -> &(dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
impl<T> Resource for T where
T: Any + Send + Sync,
T: Any + Send + Sync,
impl<T> Any for T where
T: Any,
T: Any,
fn get_type_id(&self) -> TypeId
impl<T> Event for T where
T: Send + Sync + 'static,
T: Send + Sync + 'static,