Struct nannou::geom::graph::node::Transform
[−]
[src]
pub struct Transform<S = DefaultScalar> where
S: BaseFloat, { pub scale: Vector3<S>, pub rot: Euler<Rad<S>>, pub disp: Vector3<S>, }
A node's resulting rotation, displacement and scale relative to the graph's origin.
A transform is calculated and applied to a node's vertices in the following order:
- scale:
1.0 * parent_scale * edge_scale
- rotation:
0.0 + parent_position + edge_displacement
- displacement: 0.0 + parent_orientation + edge_orientation`
Fields
scale: Vector3<S>
A scaling amount along each axis.
The scaling amount is multiplied onto each vertex of the node.
rot: Euler<Rad<S>>
A rotation amount along each axis, describing a relative orientation.
Rotates all vertices around the node origin when applied.
disp: Vector3<S>
A displacement amount along each axis.
This vector is added onto the position of each vertex of the node.
Methods
impl<S> Transform<S> where
S: BaseFloat,
[src]
S: BaseFloat,
pub fn apply_edge(&mut self, parent: &Self, edge: &Edge<S>)
[src]
Apply the given parent Edge
to this transform.
pub fn prepare(self) -> PreparedTransform<S>
[src]
Prepare this transform for application.
ⓘImportant traits for TransformedVertices<I, S>pub fn vertices<I>(self, vertices: I) -> TransformedVertices<I::IntoIter, S> where
I: IntoIterator,
I::Item: ApplyTransform<S>,
[src]
I: IntoIterator,
I::Item: ApplyTransform<S>,
Transform the given vertices.
ⓘImportant traits for TransformedTriangles<I, V, S>pub fn triangles<I, V>(
self,
triangles: I
) -> TransformedTriangles<I::IntoIter, V, S> where
I: IntoIterator<Item = Tri<V>>,
V: Vertex + ApplyTransform<S>,
[src]
self,
triangles: I
) -> TransformedTriangles<I::IntoIter, V, S> where
I: IntoIterator<Item = Tri<V>>,
V: Vertex + ApplyTransform<S>,
Transform the given vertices.
Trait Implementations
impl<S: Clone> Clone for Transform<S> where
S: BaseFloat,
[src]
S: BaseFloat,
fn clone(&self) -> Transform<S>
[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl<S: Debug> Debug for Transform<S> where
S: BaseFloat,
[src]
S: BaseFloat,
fn fmt(&self, __arg_0: &mut Formatter) -> Result
[src]
Formats the value using the given formatter. Read more
impl<S: PartialEq> PartialEq for Transform<S> where
S: BaseFloat,
[src]
S: BaseFloat,
fn eq(&self, __arg_0: &Transform<S>) -> bool
[src]
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &Transform<S>) -> bool
[src]
This method tests for !=
.
impl<S> Default for Transform<S> where
S: BaseFloat,
[src]
S: BaseFloat,
impl<S> Transform<Point3<S>> for Transform<S> where
S: BaseFloat,
[src]
S: BaseFloat,
fn one() -> Self
[src]
Create an identity transformation. That is, a transformation which does nothing. Read more
fn look_at(_eye: Point3<S>, _center: Point3<S>, _up: Vector3<S>) -> Self
[src]
Create a transformation that rotates a vector to look at center
from eye
, using up
for orientation. Read more
fn transform_vector(&self, _vec: Vector3<S>) -> Vector3<S>
[src]
Transform a vector using this transform.
fn inverse_transform_vector(&self, _vec: Vector3<S>) -> Option<Vector3<S>>
[src]
Inverse transform a vector using this transform
fn transform_point(&self, _point: Point3<S>) -> Point3<S>
[src]
Transform a point using this transform.
fn concat(&self, _other: &Self) -> Self
[src]
Combine this transform with another, yielding a new transformation which has the effects of both. Read more
fn inverse_transform(&self) -> Option<Self>
[src]
Create a transform that "un-does" this one.
fn concat_self(&mut self, other: &Self)
[src]
Combine this transform with another, in-place.