P-E-R-R-Y
Utilitaires, contrats et vendors du moteur, en une seule doc
Loading...
Searching...
No Matches
RayModel Class Reference

Raylib Model class - references a RayMesh, does not own it. More...

#include <RayModel.hpp>

Inheritance diagram for RayModel:
Collaboration diagram for RayModel:

Public Member Functions

 RayModel (RayMesh &mesh)
 ~RayModel ()=default
void setTexture (graphic::ITexture *texture) override
void setAnimations (graphic::IAnimationSet *animations) override
int getAnimationsSize () const override
void setAnimation (int pos) override
int getAnimation () const override
bool updateAnimation () override
 Steps one frame forward inside the current range.
void setFrameRange (int first, int last) override
 Restricts playback to [first, last] of the current clip.
int getFirstFrame () const override
int getLastFrame () const override
void setFrame (int frame) override
int getFrame () const override
Vector3f getPosition () const override
void setPosition (Vector3f position) override
Vector3f getRotation () const override
void setRotation (Vector3f rotation) override
Vector3f getSize () const override
void setSize (Vector3f size) override
Public Member Functions inherited from graphic::IModel
virtual ~IModel ()=default

Friends

class RayWindow

Detailed Description

Raylib Model class - references a RayMesh, does not own it.

KNOWN NON-CONFORMANCE : raylib::UpdateModelAnimation() writes the pose into the mesh's own vertex buffer. Two RayModel sharing one RayMesh cannot sit on two different animation frames at the same instant - the last updateAnimation() called wins. The contract wants the opposite ; raylib is what falls short. Sharing position/rotation/size works. Deleting the model never touches the mesh, texture or animation set it was built from/bound to.

Note: raylib::UpdateModelAnimation() writes the pose into the mesh's own vertex buffer, so two RayModel instances sharing one RayMesh cannot be at two different animation frames at the same instant - a real raylib constraint, not something this wrapper works around.

Constructor & Destructor Documentation

◆ RayModel()

RayModel::RayModel ( RayMesh & mesh)
inline

◆ ~RayModel()

RayModel::~RayModel ( )
default

Member Function Documentation

◆ getAnimation()

int RayModel::getAnimation ( ) const
inlineoverridevirtual

Implements graphic::IModel.

◆ getAnimationsSize()

int RayModel::getAnimationsSize ( ) const
inlineoverridevirtual

Implements graphic::IModel.

◆ getFirstFrame()

int RayModel::getFirstFrame ( ) const
inlineoverridevirtual

Implements graphic::IModel.

◆ getFrame()

int RayModel::getFrame ( ) const
inlineoverridevirtual

Implements graphic::IModel.

◆ getLastFrame()

int RayModel::getLastFrame ( ) const
inlineoverridevirtual

Implements graphic::IModel.

◆ getPosition()

Vector3f RayModel::getPosition ( ) const
inlineoverridevirtual

Implements graphic::IModel.

◆ getRotation()

Vector3f RayModel::getRotation ( ) const
inlineoverridevirtual

Implements graphic::IModel.

◆ getSize()

Vector3f RayModel::getSize ( ) const
inlineoverridevirtual

Implements graphic::IModel.

◆ setAnimation()

void RayModel::setAnimation ( int pos)
inlineoverridevirtual

Implements graphic::IModel.

◆ setAnimations()

void RayModel::setAnimations ( graphic::IAnimationSet * animations)
inlineoverridevirtual

Implements graphic::IModel.

◆ setFrame()

void RayModel::setFrame ( int frame)
inlineoverridevirtual

Implements graphic::IModel.

◆ setFrameRange()

void RayModel::setFrameRange ( int first,
int last )
inlineoverridevirtual

Restricts playback to [first, last] of the current clip.

A Mixamo export often bakes every move into a single clip : this is where "run" gets cut from "jump". Both bounds are clamped to the clip, and setAnimation() resets them.

Implements graphic::IModel.

◆ setPosition()

void RayModel::setPosition ( Vector3f position)
inlineoverridevirtual

Implements graphic::IModel.

◆ setRotation()

void RayModel::setRotation ( Vector3f rotation)
inlineoverridevirtual

Implements graphic::IModel.

◆ setSize()

void RayModel::setSize ( Vector3f size)
inlineoverridevirtual

Implements graphic::IModel.

◆ setTexture()

void RayModel::setTexture ( graphic::ITexture * texture)
inlineoverridevirtual

Implements graphic::IModel.

◆ updateAnimation()

bool RayModel::updateAnimation ( )
inlineoverridevirtual

Steps one frame forward inside the current range.

Returns
true when the range has just wrapped (so "the animation is over") - that is what makes play-once possible.

Implements graphic::IModel.

◆ RayWindow

friend class RayWindow
friend

The documentation for this class was generated from the following file: