当前位置: 首页>>代码示例>>Java>>正文


Java MathUtils.sinDeg方法代码示例

本文整理汇总了Java中com.badlogic.gdx.math.MathUtils.sinDeg方法的典型用法代码示例。如果您正苦于以下问题:Java MathUtils.sinDeg方法的具体用法?Java MathUtils.sinDeg怎么用?Java MathUtils.sinDeg使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.badlogic.gdx.math.MathUtils的用法示例。


在下文中一共展示了MathUtils.sinDeg方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: cos

import com.badlogic.gdx.math.MathUtils; //导入方法依赖的package包/类
/**
* //use degress
Rotation, equals
cos(angle)   sin(angle)   0
-sin(angle)  cos(angle)   0  * AffineTransform
0            0            1
*/
public static final AffineTransform AffineTransformRotate(final AffineTransform t, float anAngle, AffineTransform out) {
 float sine = MathUtils.sinDeg(anAngle);
   float cosine = MathUtils.cosDeg(anAngle);

   return AffineTransformMakeOut(t.a * cosine + t.c * sine,
                                   t.b * cosine + t.d * sine,
                                   t.c * cosine - t.a * sine,
                                   t.d * cosine - t.b * sine,
                                   t.tx,
                                   t.ty, out);
}
 
开发者ID:mingwuyun,项目名称:cocos2d-java,代码行数:19,代码来源:AffineTransform.java

示例2: progress

import com.badlogic.gdx.math.MathUtils; //导入方法依赖的package包/类
public void progress(float cx, float cy, float r, float thickness, float amt, Color c, Texture lookup) {
    //start and end angles
    float start = 0f;
    float end = amt * 360f;

    lookup.bind();
    renderer.begin(cam.combined, GL20.GL_TRIANGLE_STRIP);
    Gdx.gl.glEnable(GL20.GL_BLEND);
    Gdx.gl.glBlendFunc(GL20.GL_SRC_ALPHA, GL20.GL_ONE_MINUS_SRC_ALPHA);
    int segs = (int)(24 * Math.cbrt(r));
    end += 90f;
    start += 90f;
    float halfThick = thickness/2f;
    float step = 360f / segs;
    for (float angle=start; angle<(end+step); angle+=step) {
        float tc = 0.5f;
        if (angle==start)
            tc = 0f;
        else if (angle>=end)
            tc = 1f;

        float fx = MathUtils.cosDeg(angle);
        float fy = MathUtils.sinDeg(angle);

        float z = 0f;
        renderer.color(c.r, c.g, c.b, c.a);
        renderer.texCoord(tc, 1f);
        renderer.vertex(cx + fx * (r + halfThick), cy + fy * (r + halfThick), z);

        renderer.color(c.r, c.g, c.b, c.a);
        renderer.texCoord(tc, 0f);
        renderer.vertex(cx + fx * (r + -halfThick), cy + fy * (r + -halfThick), z);
    }
    renderer.end();
}
 
开发者ID:TudorRosca,项目名称:enklave,代码行数:36,代码来源:ScreenExtensions.java

示例3: progress

import com.badlogic.gdx.math.MathUtils; //导入方法依赖的package包/类
public void progress(float cx, float cy, float r, float thickness, float amt, Color c, Texture lookup) {
    //start and end angles
    float start = 0f;
    float end = amt * 360f;

    lookup.bind();
    renderer.begin(cam.combined, GL20.GL_TRIANGLE_STRIP);
    Gdx.gl.glEnable(GL20.GL_BLEND);
    Gdx.gl.glBlendFunc(GL20.GL_SRC_ALPHA, GL20.GL_ONE_MINUS_SRC_ALPHA);
    int segs = (int)(24 * Math.cbrt(r));
    end += 90f;
    start += 90f;
    float halfThick = thickness/2f;
    float step = 360f / segs;
    for (float angle=start; angle<(end+step); angle+=step) {
        float tc = 0.5f;
        if (angle==start)
            tc = 0f;
        else if (angle>=end)
            tc = 1f;

        float fx = MathUtils.cosDeg(angle);
        float fy = MathUtils.sinDeg(angle);

        float z = 0f;
        //renderer.
        renderer.color(c.r, c.g, c.b, c.a);
        renderer.texCoord(tc, 1f);
        renderer.vertex(cx + fx * (r + halfThick), cy + fy * (r + halfThick), z);

        renderer.color(c.r, c.g, c.b, c.a);
        renderer.texCoord(tc, 0f);
        renderer.vertex(cx + fx * (r + -halfThick), cy + fy * (r + -halfThick), z);
    }
    renderer.end();
}
 
开发者ID:TudorRosca,项目名称:enklave,代码行数:37,代码来源:ScreenRooms.java

示例4: renderCercle

import com.badlogic.gdx.math.MathUtils; //导入方法依赖的package包/类
public void renderCercle(OrthographicCamera camera,float amt, Color c){
    float start = 0f;
    float end = amt * 360f;

    lookup.bind();
    renderer.begin(camera.combined, GL20.GL_TRIANGLE_STRIP);
    Gdx.gl.glEnable(GL20.GL_BLEND);
    Gdx.gl.glBlendFunc(GL20.GL_SRC_ALPHA, GL20.GL_ONE_MINUS_SRC_ALPHA);
    int segs = (int)(24 * Math.cbrt(r));
    end += 90f;
    start += 90f;
    float halfThick = thickness/2f;
    float step = 360f / segs;
    for (float angle=start; angle<(end+step); angle+=step) {
        float tc = 0.5f;
        if (angle==start)
            tc = 0f;
        else if (angle>=end)
            tc = 1f;

        float fx = MathUtils.cosDeg(angle);
        float fy = MathUtils.sinDeg(angle);

        float z = 0f;
        //renderer.
        renderer.color(c.r, c.g, c.b, c.a);
        renderer.texCoord(tc, 1f);
        renderer.vertex(cx + fx * (r + halfThick), cy + fy * (r + halfThick), z);

        renderer.color(c.r, c.g, c.b, c.a);
        renderer.texCoord(tc, 0f);
        renderer.vertex(cx + fx * (r + -halfThick), cy + fy * (r + -halfThick), z);
    }
    renderer.end();
}
 
开发者ID:TudorRosca,项目名称:enklave,代码行数:36,代码来源:CombatFitght.java

示例5: apply

import com.badlogic.gdx.math.MathUtils; //导入方法依赖的package包/类
@Override
protected int apply (float[] vertices, int vertexStartingIndex, AttributeOffsets offsets, int vertexSize) {
	super.apply(vertices, vertexStartingIndex, offsets, vertexSize);
	final PolygonRegion region = this.region;
	final TextureRegion tRegion = region.getRegion();

	final float originX = this.originX;
	final float originY = this.originY;
	final float scaleX = this.scaleX;
	final float scaleY = this.scaleY;
	final float[] regionVertices = region.getVertices();

	final float worldOriginX = x + originX;
	final float worldOriginY = y + originY;
	final float sX = width / tRegion.getRegionWidth();
	final float sY = height / tRegion.getRegionHeight();
	final float cos = MathUtils.cosDeg(rotation);
	final float sin = MathUtils.sinDeg(rotation);

	float fx, fy;
	for (int i = 0, v = vertexStartingIndex + offsets.position, n = regionVertices.length; i < n; i += 2, v += vertexSize) {
		fx = (regionVertices[i] * sX - originX) * scaleX;
		fy = (regionVertices[i + 1] * sY - originY) * scaleY;
		vertices[v] = cos * fx - sin * fy + worldOriginX;
		vertices[v + 1] = sin * fx + cos * fy + worldOriginY;
	}

	return numVertices;
}
 
开发者ID:CypherCove,项目名称:gdx-cclibs,代码行数:30,代码来源:Poly2D.java

示例6: renderCercleRecharge

import com.badlogic.gdx.math.MathUtils; //导入方法依赖的package包/类
public void renderCercleRecharge(OrthographicCamera camera,float amt, Color c){
    float start = 0f;
    float end = amt * 360f;

    lookup.bind();
    renderer.begin(camera.combined, GL20.GL_TRIANGLE_STRIP);
    Gdx.gl.glEnable(GL20.GL_BLEND);
    Gdx.gl.glBlendFunc(GL20.GL_SRC_ALPHA, GL20.GL_ONE_MINUS_SRC_ALPHA);
    int segs = (int)(24 * Math.cbrt(r));
    end += 90f;
    start += 90f;
    float halfThick = thickness/2f;
    float step = 360f / segs;
    for (float angle=start; angle<(end+step); angle+=step) {
        float tc = 0.5f;
        if (angle==start)
            tc = 0f;
        else if (angle>=end)
            tc = 1f;

        float fx = MathUtils.cosDeg(angle);
        float fy = MathUtils.sinDeg(angle);

        float z = 0f;
        //renderer.
        renderer.color(c.r, c.g, c.b, c.a);
        renderer.texCoord(tc, 1f);
        renderer.vertex(c1x + fx * (r + halfThick), c1y + fy * (r + halfThick), z);

        renderer.color(c.r, c.g, c.b, c.a);
        renderer.texCoord(tc, 0f);
        renderer.vertex(c1x + fx * (r + -halfThick), c1y + fy * (r + -halfThick), z);
    }
    renderer.end();
}
 
开发者ID:TudorRosca,项目名称:enklave,代码行数:36,代码来源:CombatFitght.java


注:本文中的com.badlogic.gdx.math.MathUtils.sinDeg方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。