Struct nphysics3d::algebra::Force3 [−][src]
A force with a linear and agular (torque) component.
Fields
linear: Vector3<N>
The linear force.
angular: Vector3<N>
The linear force.
Methods
impl<N: Real> Force3<N>
[src]
impl<N: Real> Force3<N>
pub fn new(linear: Vector3<N>, angular: Vector3<N>) -> Self
[src]
pub fn new(linear: Vector3<N>, angular: Vector3<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 linear part are stored first.
pub fn from_vector<S: Storage<N, U6>>(data: &Vector<N, U6, S>) -> Self
[src]
pub fn from_vector<S: Storage<N, U6>>(data: &Vector<N, U6, S>) -> Self
Create a force from a vector where the linear part are stored first.
pub fn torque(torque: Vector3<N>) -> Self
[src]
pub fn torque(torque: Vector3<N>) -> Self
Create a pure torque.
pub fn torque_from_vector(torque: Vector3<N>) -> Self
[src]
pub fn torque_from_vector(torque: Vector3<N>) -> Self
Create a pure torque.
pub fn torque_at_point(torque: Vector3<N>, point: &Point3<N>) -> Self
[src]
pub fn torque_at_point(torque: Vector3<N>, point: &Point3<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: Vector3<N>,
point: &Point3<N>
) -> Self
[src]
pub fn torque_from_vector_at_point(
torque: Vector3<N>,
point: &Point3<N>
) -> Self
Creates the resultant of a torque applied at the given point (relative to the center of mass).
pub fn linear(linear: Vector3<N>) -> Self
[src]
pub fn linear(linear: Vector3<N>) -> Self
Create a pure linear force.
pub fn linear_at_point(linear: Vector3<N>, point: &Point3<N>) -> Self
[src]
pub fn linear_at_point(linear: Vector3<N>, point: &Point3<N>) -> Self
Creates the resultant of a linear force applied at the given point (relative to the center of mass).
pub fn angular_vector(&self) -> Vector3<N>
[src]
pub fn angular_vector(&self) -> Vector3<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) -> &Vector6<N>
[src]
pub fn as_vector(&self) -> &Vector6<N>
This force seen as a vector.
The linear part of the force are stored first.
pub fn as_vector_mut(&mut self) -> &mut Vector6<N>
[src]
pub fn as_vector_mut(&mut self) -> &mut Vector6<N>
This force seen as a mutable vector.
The linear part of the force are stored first.
Trait Implementations
impl<N: Copy + Real> Copy for Force3<N>
[src]
impl<N: Copy + Real> Copy for Force3<N>
impl<N: Clone + Real> Clone for Force3<N>
[src]
impl<N: Clone + Real> Clone for Force3<N>
fn clone(&self) -> Force3<N>
[src]
fn clone(&self) -> Force3<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 Force3<N>
[src]
impl<N: Debug + Real> Debug for Force3<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<Force3<N>> for Force3<N>
[src]
impl<N: Real> Add<Force3<N>> for Force3<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<Force3<N>> for Force3<N>
[src]
impl<N: Real> AddAssign<Force3<N>> for Force3<N>
fn add_assign(&mut self, rhs: Self)
[src]
fn add_assign(&mut self, rhs: Self)
Performs the +=
operation.
impl<N: Real> Sub<Force3<N>> for Force3<N>
[src]
impl<N: Real> Sub<Force3<N>> for Force3<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<Force3<N>> for Force3<N>
[src]
impl<N: Real> SubAssign<Force3<N>> for Force3<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 Force3<N>
[src]
impl<N: Real> Mul<N> for Force3<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 Force3<N>
[src]
impl<N: Real> Neg for Force3<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<Force3<N>> for Inertia3<N>
[src]
impl<N: Real> Mul<Force3<N>> for Inertia3<N>