pub struct RobotTurtleState {
pub position: Vec3,
pub rotation: Quat,
pub current_module_id: Option<ModuleId>,
pub joint_config: ActiveJointConfig,
pub material_id: MaterialId,
pub width: f32,
}Expand description
The state of the Robot Builder Turtle.
Tracks position, orientation, and the topological context (which module we are currently extending).
Fields§
§position: Vec3Current world-space position of the “cursor”.
rotation: QuatCurrent world-space orientation.
current_module_id: Option<ModuleId>The ID of the module (rigid body) the turtle is currently “standing on”. If this is Some(id), the NEXT spawned module will be jointed to this one.
joint_config: ActiveJointConfigConfiguration for the next joint creation.
material_id: MaterialIdCurrent material ID for new modules.
width: f32Current default width/radius for shapes (can be modified by !).
Implementations§
Source§impl RobotTurtleState
impl RobotTurtleState
Sourcepub fn forward(&self) -> Vec3
pub fn forward(&self) -> Vec3
Returns the turtle’s local forward direction (Z-axis) in world space.
Sourcepub fn right(&self) -> Vec3
pub fn right(&self) -> Vec3
Returns the turtle’s local right direction (X-axis) in world space.
Sourcepub fn rotate_local_x(&mut self, angle: f32)
pub fn rotate_local_x(&mut self, angle: f32)
Rotates the turtle around its local X axis by angle radians (Pitch).
Sourcepub fn rotate_local_y(&mut self, angle: f32)
pub fn rotate_local_y(&mut self, angle: f32)
Rotates the turtle around its local Y axis by angle radians (Roll).
Sourcepub fn rotate_local_z(&mut self, angle: f32)
pub fn rotate_local_z(&mut self, angle: f32)
Rotates the turtle around its local Z axis by angle radians (Yaw).
Trait Implementations§
Source§impl Clone for RobotTurtleState
impl Clone for RobotTurtleState
Source§fn clone(&self) -> RobotTurtleState
fn clone(&self) -> RobotTurtleState
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for RobotTurtleState
impl Debug for RobotTurtleState
Source§impl Default for RobotTurtleState
impl Default for RobotTurtleState
Source§impl<'de> Deserialize<'de> for RobotTurtleState
impl<'de> Deserialize<'de> for RobotTurtleState
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Auto Trait Implementations§
impl Freeze for RobotTurtleState
impl RefUnwindSafe for RobotTurtleState
impl Send for RobotTurtleState
impl Sync for RobotTurtleState
impl Unpin for RobotTurtleState
impl UnsafeUnpin for RobotTurtleState
impl UnwindSafe for RobotTurtleState
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more