Class Index | File Index

Classes


Class enchant.PhyPolygonSprite


Extends enchant.PhySprite.

Defined in: PhySprite.enchant.js.

Class Summary
Constructor Attributes Constructor Name and Description
 
enchant.PhyPolygonSprite(width, height, vertexs, type, density, friction, restitution, awake)
多角形の物理シミュレーション用Sprite
Fields borrowed from class enchant.PhySprite:
active, angle, angularVelocity, centerX, centerY, position, sleep, type, velocity, visible, vx, vy, x, y
Methods borrowed from class enchant.PhySprite:
applyForce, applyImpulse, applyTorque, contact, createPhyBox, createPhyCircle, createPhyPolygon, destroy, getBody, isDynamic, isKinematic, isStatic, setAwake, setDegugImage
Class Detail
enchant.PhyPolygonSprite(width, height, vertexs, type, density, friction, restitution, awake)
多角形の物理シミュレーション用Sprite
var vertexCount = 5;
var radius = 20;
var vertexs = new Array();
for (var i = 0; i < vertexCount; i++) {
    vertexs[i] = new b2Vec2(radius * Math.cos(2 * Math.PI / vertexCount * i), radius * Math.sin(2 * Math.PI / vertexCount * i));
}
var phyPolygonSprite = new PhyPolygonSprite(radius * 2, radius * 2,vertexs, DYNAMIC_SPRITE, 1.0, 0.1, 0.2, true);
Parameters:
{Number} width Optional
Spriteの横幅.
{Number} height Optional
Spriteの高さ.
{b2Vec2[]} vertexs
多角形の頂点配列
{Boolean} type Optional
静的,動的,キネマティック
{Number} density Optional
Spriteの密度.
{Number} friction Optional
Spriteの摩擦.
{Number} restitution Optional
Spriteの反発.
{Boolean} awake Optional
Spriteが初めから物理演算を行うか.

Documentation generated by JsDoc Toolkit 2.4.0 on Sat Mar 31 2012 19:45:17 GMT+0900 (JST)