Skip to main content

TypedDomain

Struct TypedDomain 

Source
pub struct TypedDomain<S: DomainSpace> { /* private fields */ }

Implementations§

Source§

impl<S: DomainSpace> TypedDomain<S>

Source

pub fn handle(&self) -> DomainHandle<S>

Source

pub fn space(&self) -> &S

Source

pub fn poses(&self) -> &Store<Pose<S>>

Source

pub fn instances(&self) -> &Store<Instance>

Source

pub fn instance_mut(&mut self, entity: Entity) -> Option<&mut Instance>

Source

pub fn remove_instance( &mut self, entity: Entity, ) -> Result<Instance, StoreError>

Source

pub fn set_pose( &mut self, entity: Entity, pose: Pose<S>, ) -> Result<(), DomainError>

Inside a tick the move is drawn blended across that tick; outside one it is drawn at once.

Source

pub fn teleport( &mut self, entity: Entity, pose: Pose<S>, ) -> Result<(), DomainError>

Moves without drawing the poses in between, for a jump such as a respawn.

Source

pub fn drawn_pose(&self, entity: Entity, alpha: f32) -> Option<Pose<S>>

The pose publish_at(alpha) draws: blended across the last tick when only that tick wrote the pose, otherwise the current pose.

Source

pub fn set_point( &mut self, entity: Entity, point: S::Point, ) -> Result<(), DomainError>

Source

pub fn set_frame( &mut self, entity: Entity, frame: S::Frame, ) -> Result<(), DomainError>

Source

pub fn add_view(&mut self, spec: ViewSpec<S>) -> Result<ViewId, DomainError>

Source

pub fn view(&self, id: ViewId) -> Option<&ViewStyle<S>>

Source

pub fn view_eye(&self, id: ViewId) -> Option<Entity>

Source

pub fn view_subject(&self, id: ViewId) -> Option<Entity>

Source

pub fn view_mut(&mut self, id: ViewId) -> Option<&mut ViewStyle<S>>

Source

pub fn set_view_eye( &mut self, id: ViewId, eye: Entity, ) -> Result<(), DomainError>

Source

pub fn set_view_subject( &mut self, id: ViewId, subject: Option<Entity>, ) -> Result<(), DomainError>

Source

pub fn fields(&self) -> Option<&Store<Field>>

Source

pub fn field_mut(&mut self, entity: Entity) -> Option<&mut Field>

Source

pub fn remove_field(&mut self, entity: Entity) -> Result<Field, StoreError>

Source

pub fn walk( &mut self, entity: Entity, velocity: S::Vector, dt: f32, ) -> Result<(), DomainError>

Source

pub fn move_to( &mut self, entity: Entity, point: ChartPoint, ) -> Result<(), DomainError>

Source§

impl<S> TypedDomain<S>
where S: Homogeneous + PhysicsSpace + Copy, S::Vector: VectorOps + Default, S::Point: Sub<Output = S::Vector>,

Source

pub fn spawn_body( &mut self, entity: Entity, body: BodyDef<S>, ) -> Result<BodyId, DomainError>

Source§

impl<S> TypedDomain<S>
where S: Homogeneous + PhysicsSpace + Copy, S::Vector: VectorOps + Default, S::Point: Sub<Output = S::Vector>,

Source

pub fn physics(&self) -> Option<&Physics<S>>

Source

pub fn physics_mut(&mut self) -> Option<&mut Physics<S>>

Trait Implementations§

Source§

impl<S: DomainSpace> Domain for TypedDomain<S>

Source§

fn id(&self) -> DomainId

Source§

fn name(&self) -> &'static str

Source§

fn tracks_changes(&self) -> bool

Source§

fn views(&self) -> &[ViewTarget]

Source§

fn view(&self, id: ViewId) -> Option<ViewSummary>

Source§

fn pick( &self, view: ViewId, ray: &ImageRay, placement: Rigid, views: &Views, prepared: &[PreparedGeometry], ) -> Option<Pick>

Source§

fn image_of(&self, view: ViewId, entity: Entity) -> Option<[f32; 3]>

Source§

fn lift_origin( &self, view: ViewId, ray: &ImageRay, ) -> Result<ChartPoint, DomainError>

Source§

fn compile_fields(&mut self) -> Result<FieldCost, DomainError>

Source§

fn field_program(&self) -> &FieldProgram

Source§

fn as_any(&self) -> &dyn Any

Source§

fn as_any_mut(&mut self) -> &mut dyn Any

Auto Trait Implementations§

§

impl<S> !Freeze for TypedDomain<S>

§

impl<S> !RefUnwindSafe for TypedDomain<S>

§

impl<S> Send for TypedDomain<S>

§

impl<S> !Sync for TypedDomain<S>

§

impl<S> Unpin for TypedDomain<S>
where S: Unpin, <S as Space>::Point: Unpin, <S as Space>::Frame: Unpin,

§

impl<S> UnsafeUnpin for TypedDomain<S>
where S: UnsafeUnpin,

§

impl<S> !UnwindSafe for TypedDomain<S>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more