[][src]Struct crystal_engine::GameState

pub struct GameState {
    pub camera: Matrix4<f32>,
    pub keyboard: KeyboardState,
    // some fields omitted
}

Contains the game state. This struct is passed to Game::init and Game::update.

Fields

camera: Matrix4<f32>

The matrix of the camera currently in use.

It is currently not possible to change the near and far boundaries of the camera. This might be added in a later version.

keyboard: KeyboardState

Get the current keyboard state.

Implementations

impl GameState[src]

pub fn terminate_game(&mut self)[src]

Exit the game. Once this function is called, it cannot be cancelled. This does not confirm with Game::can_shutdown.

pub fn create_triangle_model(&mut self) -> ModelHandle[src]

Create a new triangle at the origin of the world. See ModelHandle for information on how to move and rotate the triangle.

To create a second instance with the same model, simply call ModelHandle::clone

pub fn create_model_from_obj(&mut self, path: impl AsRef<Path>) -> ModelHandle[src]

Load a model from the given path and place it at the origin of the world. See ModelHandle for information on how to move and rotate the triangle.

To create a second instance with the same model, simply call ModelHandle::clone

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Content for T[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> SafeBorrow<T> for T[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,