pub struct GraphicsManager {
pub gfx_shift: Vector,
/* private fields */
}Fields§
§gfx_shift: VectorGraphics offset
Implementations§
Source§impl GraphicsManager
impl GraphicsManager
pub fn new() -> GraphicsManager
pub fn clear(&mut self)
Sourcepub fn set_colliders_visible(&mut self, visible: bool)
pub fn set_colliders_visible(&mut self, visible: bool)
Show or hide every collider-derived render node (instanced
primitives + complex individual meshes). The global
DRAW_SURFACES flag still wins when off.
Sourcepub fn set_body_render_meshes_visible(&mut self, visible: bool)
pub fn set_body_render_meshes_visible(&mut self, visible: bool)
Show or hide body-attached render-only meshes registered via
Self::add_body_render_mesh.
Sourcepub fn add_body_render_mesh(
&mut self,
_window: &mut Window,
body: RigidBodyHandle,
shape: &SharedShape,
local_pose: Pose,
color: Color,
uvs: Option<&[[f32; 2]]>,
normals: Option<&[[f32; 3]]>,
texture: Option<&Path>,
)
pub fn add_body_render_mesh( &mut self, _window: &mut Window, body: RigidBodyHandle, shape: &SharedShape, local_pose: Pose, color: Color, uvs: Option<&[[f32; 2]]>, normals: Option<&[[f32; 3]]>, texture: Option<&Path>, )
Attach a render-only mesh to a rigid body. The mesh follows the
body’s pose at every frame, transformed by local_pose. It does
not participate in physics in any way — this is purely a
visualization channel for things like MJCF <geom> elements with
contype = conaffinity = 0.
uvs is an optional per-vertex UV buffer (parallel to the
shape’s vertex buffer when the shape is a TriMesh). It’s
only consulted when texture is also Some — there’s no point
uploading UVs that no shader can sample.
texture is a path to a 2D color image on disk. kiss3d loads
it via set_texture_from_file and caches it under the path’s
string form, so multiple meshes referencing the same file share
a single GPU texture.
pub fn scene(&self) -> &SceneNode
pub fn scene_mut(&mut self) -> &mut SceneNode
Sourcepub fn body_attached_nodes(&self) -> impl Iterator<Item = &BodyAttachedNode>
pub fn body_attached_nodes(&self) -> impl Iterator<Item = &BodyAttachedNode>
Iterator over every render-only mesh attached to a rigid body
via Self::add_body_render_mesh. Lets “Frame all” union the
visual meshes’ AABBs alongside the colliders’ so models whose
visual extent is bigger than their collision extent (or whose
physics-significant geoms are tiny next to the rendered mesh)
still fit in the frame.
pub fn remove_collider_nodes(&mut self, collider: ColliderHandle)
pub fn remove_body_nodes(&mut self, body: RigidBodyHandle)
pub fn set_body_color( &mut self, b: RigidBodyHandle, color: Color, tmp_color: bool, )
pub fn set_initial_body_color(&mut self, b: RigidBodyHandle, color: Color)
pub fn set_initial_collider_color(&mut self, c: ColliderHandle, color: Color)
pub fn set_body_wireframe(&mut self, b: RigidBodyHandle, enabled: bool)
pub fn toggle_wireframe_mode(&mut self, _colliders: &ColliderSet, enabled: bool)
pub fn next_color(&mut self) -> Rgba<f32>
pub fn add_body_colliders( &mut self, window: &mut Window, handle: RigidBodyHandle, bodies: &RigidBodySet, colliders: &ColliderSet, )
pub fn add_body_colliders_with_color( &mut self, window: &mut Window, handle: RigidBodyHandle, bodies: &RigidBodySet, colliders: &ColliderSet, color: Color, )
pub fn add_collider( &mut self, window: &mut Window, handle: ColliderHandle, colliders: &ColliderSet, )
pub fn add_shape( &mut self, _window: &mut Window, handle: ColliderHandle, body: Option<RigidBodyHandle>, shape: &dyn Shape, sensor: bool, delta: Pose, color: Color, )
pub fn draw( &mut self, flags: TestbedStateFlags, _bodies: &RigidBodySet, colliders: &ColliderSet, )
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for GraphicsManager
impl !Send for GraphicsManager
impl !Sync for GraphicsManager
impl !UnwindSafe for GraphicsManager
impl Freeze for GraphicsManager
impl Unpin for GraphicsManager
impl UnsafeUnpin for GraphicsManager
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> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
Source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
ReadEndian::read_from_little_endian().Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.