Struct nphysics3d::algebra::Force2 [−][src]
A force with a linear and agular (torque) component.
Fields
linear: Vector2<N>
The linear force.
angular: N
The torque.
Methods
impl<N: Real> Force2<N>
[src]
impl<N: Real> Force2<N>
pub fn new(linear: Vector2<N>, angular: N) -> Self
[src]
pub fn new(linear: Vector2<N>, angular: N) -> Self
Creates a force from its linear and angular components.
pub fn zero() -> Self
[src]
pub fn zero() -> Self
A zero force.
pub fn from_slice(data: &[N]) -> Self
[src]
pub fn from_slice(data: &[N]) -> Self
Create a force from a slice where the entries 0 and 1 are for the linear part and 2 for the angular part.
pub fn from_vector<S: Storage<N, U3>>(data: &Vector<N, U3, S>) -> Self
[src]
pub fn from_vector<S: Storage<N, U3>>(data: &Vector<N, U3, S>) -> Self
Create a force from a vector where the entries 0 and 1 are for the linear part and 2 for the angular part.
pub fn torque(torque: N) -> Self
[src]
pub fn torque(torque: N) -> Self
Create a pure torque.
pub fn torque_from_vector(torque: Vector1<N>) -> Self
[src]
pub fn torque_from_vector(torque: Vector1<N>) -> Self
Create a pure torque.
pub fn linear(linear: Vector2<N>) -> Self
[src]
pub fn linear(linear: Vector2<N>) -> Self
Create a pure linear force.
pub fn linear_at_point(linear: Vector2<N>, point: &Point2<N>) -> Self
[src]
pub fn linear_at_point(linear: Vector2<N>, point: &Point2<N>) -> Self
Creates the resultant of a linear force applied at the given point (relative to the center of mass).
pub fn torque_at_point(torque: N, point: &Point2<N>) -> Self
[src]
pub fn torque_at_point(torque: N, point: &Point2<N>) -> Self
Creates the resultant of a torque applied at the given point (relative to the center of mass).
pub fn torque_from_vector_at_point(
torque: Vector1<N>,
point: &Point2<N>
) -> Self
[src]
pub fn torque_from_vector_at_point(
torque: Vector1<N>,
point: &Point2<N>
) -> Self
Creates the resultant of a torque applied at the given point (relative to the center of mass).
pub fn angular_vector(&self) -> Vector1<N>
[src]
pub fn angular_vector(&self) -> Vector1<N>
The angular part of the force.
pub fn as_slice(&self) -> &[N]
[src]
pub fn as_slice(&self) -> &[N]
This force seen as a slice.
The two first entries contain the linear part and the third entry contais the angular part.
pub fn as_vector(&self) -> &Vector3<N>
[src]
pub fn as_vector(&self) -> &Vector3<N>
This force seen as a vector.
The two first entries contain the linear part and the third entry contais the angular part.
pub fn as_vector_mut(&mut self) -> &mut Vector3<N>
[src]
pub fn as_vector_mut(&mut self) -> &mut Vector3<N>
This force seen as a mutable vector.
The two first entries contain the linear part and the third entry contais the angular part.
Trait Implementations
impl<N: Copy + Real> Copy for Force2<N>
[src]
impl<N: Copy + Real> Copy for Force2<N>
impl<N: Clone + Real> Clone for Force2<N>
[src]
impl<N: Clone + Real> Clone for Force2<N>
fn clone(&self) -> Force2<N>
[src]
fn clone(&self) -> Force2<N>
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
impl<N: Debug + Real> Debug for Force2<N>
[src]
impl<N: Debug + Real> Debug for Force2<N>
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl<N: Real> Add<Force2<N>> for Force2<N>
[src]
impl<N: Real> Add<Force2<N>> for Force2<N>
type Output = Self
The resulting type after applying the +
operator.
fn add(self, rhs: Self) -> Self
[src]
fn add(self, rhs: Self) -> Self
Performs the +
operation.
impl<N: Real> AddAssign<Force2<N>> for Force2<N>
[src]
impl<N: Real> AddAssign<Force2<N>> for Force2<N>
fn add_assign(&mut self, rhs: Self)
[src]
fn add_assign(&mut self, rhs: Self)
Performs the +=
operation.
impl<N: Real> Sub<Force2<N>> for Force2<N>
[src]
impl<N: Real> Sub<Force2<N>> for Force2<N>
type Output = Self
The resulting type after applying the -
operator.
fn sub(self, rhs: Self) -> Self
[src]
fn sub(self, rhs: Self) -> Self
Performs the -
operation.
impl<N: Real> SubAssign<Force2<N>> for Force2<N>
[src]
impl<N: Real> SubAssign<Force2<N>> for Force2<N>
fn sub_assign(&mut self, rhs: Self)
[src]
fn sub_assign(&mut self, rhs: Self)
Performs the -=
operation.
impl<N: Real> Mul<N> for Force2<N>
[src]
impl<N: Real> Mul<N> for Force2<N>
type Output = Self
The resulting type after applying the *
operator.
fn mul(self, rhs: N) -> Self
[src]
fn mul(self, rhs: N) -> Self
Performs the *
operation.
impl<N: Real> Neg for Force2<N>
[src]
impl<N: Real> Neg for Force2<N>
type Output = Self
The resulting type after applying the -
operator.
fn neg(self) -> Self
[src]
fn neg(self) -> Self
Performs the unary -
operation.
impl<N: Real> Mul<Force2<N>> for Inertia2<N>
[src]
impl<N: Real> Mul<Force2<N>> for Inertia2<N>