Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Two frame animated models #16

Closed
Robadob opened this issue Apr 8, 2020 · 2 comments · Fixed by #97
Closed

Two frame animated models #16

Robadob opened this issue Apr 8, 2020 · 2 comments · Fixed by #97
Labels
enhancement New feature or request shaders

Comments

@Robadob
Copy link
Member

Robadob commented Apr 8, 2020

e.g. FGPU1 Pedestrian rendering.

@Robadob
Copy link
Member Author

Robadob commented Aug 11, 2022

Currently model is set via

    /**
     * Use a model from file
     * @param modelPath The path to the model's file (must be .obj)
     * @param texturePath Optional path to the texture used by the model
     */
    void setModel(const std::string &modelPath, const std::string &texturePath = "");
    /**
     * Use a stock model
     * @param model Model from the libraries internal resources
     */
    void setModel(const Stock::Models::Model &model);

To support KeyFrame'd animation models we'd need an alt version, e.g.

    /**
     * Use a keyframe animated model from file
     * @param modelPathA The path to the model's first file (must be .obj)
     * @param modelPathB The path to the model's second file (must be .obj, have the same number of vertices/polygons as the first file)
     * @param lerpVariableName Name of the agent variable used for controlling linear interpolation between the two frames. This must be a `float` type variable with a value in the inclusive-inclusive range [0, 1]
     * @param texturePath Optional path to the texture used by the two models
     * @see setModel(const std::string &, const std::string &) This version can be used to provide agents a static model
     */
    void setKeyFrameModel(const std::string &modelPathA, const std::string &modelPathB, const std::string &lerpVariableName, const std::string &texturePath = "");
    /**
     * Use a stock keyframe animated model
     * @param model Model from the libraries internal resources
     * @param lerpVariableName Name of the agent variable used for controlling linear interpolation between the two frames. This must be a `float` type variable with a value in the inclusive-inclusive range [0, 1]
     * @see setModel(const Stock::Models::Model &) This version can be used to provide agents a static model
     */
    void setKeyFrameModel(const Stock::Models::KeyFrameModel &model, const std::string &lerpVariableName);

Internally, we can have an additional var for 2nd model/lerp var name, and assume its static if neither is set.

Bit more complicated, because different agent states can have different models. Possible there will be an issue/bug, if a user tries to mix static and keyframe'd, would need to check on this when working on it.

cc @mondus

@mondus
Copy link
Member

mondus commented Aug 12, 2022

Yeah I like this its nice and tidy.

Robadob added a commit that referenced this issue Aug 15, 2022
Robadob added a commit that referenced this issue Aug 15, 2022
Robadob added a commit that referenced this issue Aug 17, 2022
@mondus mondus closed this as completed in ef676da Aug 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request shaders
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants