pub struct CameraRig3D { /* private fields */ }Expand description
Production 3D game camera rig supporting Spring-Arm, Orbit, First-Person, Catmull-Rom Spline, and Perlin Trauma Shake.
Implementations§
Source§impl CameraRig3D
Spring-Arm, Orbit, First-Person, Catmull-Rom Spline Rail, and Perlin Trauma Shake for CameraRig3D.
impl CameraRig3D
Spring-Arm, Orbit, First-Person, Catmull-Rom Spline Rail, and Perlin Trauma Shake for CameraRig3D.
Sourcepub fn new(config: CameraRigConfig, seed: u64) -> Self
pub fn new(config: CameraRigConfig, seed: u64) -> Self
Sourcepub fn apply_look_delta(&mut self, delta_yaw: f32, delta_pitch: f32)
pub fn apply_look_delta(&mut self, delta_yaw: f32, delta_pitch: f32)
Applies yaw and pitch input deltas in radians, clamping pitch inside configured limits.
§Arguments
f32- Horizontal yaw delta in radians.f32- Vertical pitch delta in radians.
Sourcepub fn add_trauma(&mut self, amount: f32)
pub fn add_trauma(&mut self, amount: f32)
Adds impact trauma clamped into [0.0, 1.0] to trigger smooth Perlin camera shake.
§Arguments
f32- Non-negative trauma impulse.
Sourcepub fn sample_spline(&self, t: f32) -> Option<CameraSplinePoint>
pub fn sample_spline(&self, t: f32) -> Option<CameraSplinePoint>
Sourcepub fn update(
&mut self,
dt: f32,
follow_target: Vec3,
obstacles: &[AxisAlignedBox3D],
) -> CameraRigState
pub fn update( &mut self, dt: f32, follow_target: Vec3, obstacles: &[AxisAlignedBox3D], ) -> CameraRigState
Updates the camera rig for frame step dt, resolving spring-arm obstacles and Perlin trauma shake.
§Arguments
f32- Frame delta time in seconds.Vec3- Followed subject anchor position in world space.&[AxisAlignedBox3D]- World geometry obstacles for spring-arm ray pullback.
§Returns
CameraRigState- Updated world-space camera pose for this frame.
Source§impl CameraRig3D
Implements impl #impl_generics #name #ty_generics #where_clause.
impl CameraRig3D
Implements impl #impl_generics #name #ty_generics #where_clause.
pub fn get_config(&self) -> CameraRigConfig
pub fn get_mut_config(&mut self) -> &mut CameraRigConfig
pub fn set_config(&mut self, val: CameraRigConfig) -> &mut Self
pub fn get_desired_yaw(&self) -> f32
pub fn get_mut_desired_yaw(&mut self) -> &mut f32
pub fn set_desired_yaw(&mut self, val: f32) -> &mut Self
pub fn get_desired_pitch(&self) -> f32
pub fn get_mut_desired_pitch(&mut self) -> &mut f32
pub fn set_desired_pitch(&mut self, val: f32) -> &mut Self
pub fn get_smooth_position(&self) -> Vec3
pub fn get_mut_smooth_position(&mut self) -> &mut Vec3
pub fn set_smooth_position(&mut self, val: Vec3) -> &mut Self
pub fn get_smooth_target(&self) -> Vec3
pub fn get_mut_smooth_target(&mut self) -> &mut Vec3
pub fn set_smooth_target(&mut self, val: Vec3) -> &mut Self
pub fn get_smooth_yaw(&self) -> f32
pub fn get_mut_smooth_yaw(&mut self) -> &mut f32
pub fn set_smooth_yaw(&mut self, val: f32) -> &mut Self
pub fn get_smooth_pitch(&self) -> f32
pub fn get_mut_smooth_pitch(&mut self) -> &mut f32
pub fn set_smooth_pitch(&mut self, val: f32) -> &mut Self
pub fn get_smooth_fov_deg(&self) -> f32
pub fn get_mut_smooth_fov_deg(&mut self) -> &mut f32
pub fn set_smooth_fov_deg(&mut self, val: f32) -> &mut Self
pub fn get_current_arm_length(&self) -> f32
pub fn get_mut_current_arm_length(&mut self) -> &mut f32
pub fn set_current_arm_length(&mut self, val: f32) -> &mut Self
pub fn get_trauma(&self) -> f32
pub fn get_mut_trauma(&mut self) -> &mut f32
pub fn set_trauma(&mut self, val: f32) -> &mut Self
pub fn get_shake_clock(&self) -> f32
pub fn get_mut_shake_clock(&mut self) -> &mut f32
pub fn set_shake_clock(&mut self, val: f32) -> &mut Self
pub fn get_spline_t(&self) -> f32
pub fn get_mut_spline_t(&mut self) -> &mut f32
pub fn set_spline_t(&mut self, val: f32) -> &mut Self
pub fn get_spline_points(&self) -> &Vec<CameraSplinePoint>
pub fn get_mut_spline_points(&mut self) -> &mut Vec<CameraSplinePoint>
pub fn set_spline_points(&mut self, val: Vec<CameraSplinePoint>) -> &mut Self
pub fn get_state(&self) -> CameraRigState
pub fn get_mut_state(&mut self) -> &mut CameraRigState
pub fn set_state(&mut self, val: CameraRigState) -> &mut Self
Trait Implementations§
Source§impl Clone for CameraRig3D
impl Clone for CameraRig3D
Auto Trait Implementations§
impl Forget for CameraRig3D
impl Freeze for CameraRig3D
impl Move for CameraRig3D
impl RefUnwindSafe for CameraRig3D
impl Send for CameraRig3Dwhere
RawVecInner: Send,
impl Sync for CameraRig3Dwhere
RawVecInner: Sync,
impl Unpin for CameraRig3D
impl UnsafeUnpin for CameraRig3D
impl UnwindSafe for CameraRig3Dwhere
RawVecInner: UnwindSafe,
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
Mutably borrows from an owned value. Read more