Click here to Skip to main content
15,895,142 members
Articles / Mobile Apps / Android

One-Touch Casual 3D Game Based on OpenGL ES 2.0 3D Engine with Lua, Bullet, and Vorbis Support

Rate me:
Please Sign up or sign in to vote.
4.75/5 (7 votes)
8 Nov 2012CPOL5 min read 50.5K   3.3K   18  
Android-x86 native game-engine - without JNI
#ifndef ANIMATIONVALUE_H_
#define ANIMATIONVALUE_H_

#include "Animation.h"

namespace gameplay
{

/**
 * The runtime interface to represent an animation value.
 */
class AnimationValue
{
    friend class AnimationClip;

public:

    /**
     * Gets the value at the specified index.
     *
     * @param index The index of the component to get the value for.
     *
     * @return The float value at the specified index.
     */
    float getFloat(unsigned int index) const;

    /**
     * Sets the value at the specified index.
     *
     * @param index The index of the component to set the value for.
     * @param value The value to set the component to.
     */
    void setFloat(unsigned int index, float value);

    /**
     * Copies one or more float values from this AnimationValue into the specified array.
     *
     * @param index The index to start copying from.
     * @param values Pointer to float array to copy values into.
     * @param count Number of values to copy.
     */
    void getFloats(unsigned int index, float* values, unsigned int count) const;

    /**
     * Copies one or more float values into the AnimationValue.
     *
     * @param index The index of the first component to set the value for.
     * @param values Array of values to copy into the AnimationValue.
     * @param count Number of values to in the array to copy in.
     */
    void setFloats(unsigned int index, float* values, unsigned int count);

private:

    /**
     * Constructor.
     */
    AnimationValue();

    /**
     * Constructor.
     */
    AnimationValue(unsigned int componentCount);

    /**
     * Constructor.
     */
    AnimationValue(const AnimationValue& copy);

    /**
     * Destructor.
     */
    ~AnimationValue();

    /**
     * Hidden copy assignment operator.
     */
    AnimationValue& operator=(const AnimationValue& v);

    unsigned int _componentCount;   // The number of float values for the property.
    unsigned int _componentSize;    // The number of bytes of memory the property is.
    float* _value;                  // The current value of the property.

};

}

#endif

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
India India
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions