CCMacros.java :  » UnTagged » quiniandroid » org » cocos2d » types » Android Open Source

Android Open Source » UnTagged » quiniandroid 
quiniandroid » org » cocos2d » types » CCMacros.java
package org.cocos2d.types;

import javax.microedition.khronos.opengles.GL10;

public class CCMacros {

    public static final int INT_MIN = -2147483648;

    /// returns a random float between -1 and 1
    public static float CCRANDOM_MINUS1_1() {
        return (float) Math.random() * 2.0f - 1.0f;
    }

    /// returns a random float between 0 and 1
    public static float CCRANDOM_0_1() {
        return (float) Math.random();
    }

    // default gl blend src function
    public static final int CC_BLEND_SRC = GL10.GL_SRC_ALPHA;

    // default gl blend dst function
    public static final int CC_BLEND_DST = GL10.GL_ONE_MINUS_SRC_ALPHA;

    public static float CC_DEGREES_TO_RADIANS(float angle) {
        return (angle / 180.0f * (float) Math.PI);
    }

    public static float CC_RADIANS_TO_DEGREES(float angle) {
        return (angle / (float) Math.PI * 180.0f);
    }


}
java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.