MCPcopy
hub / github.com/KilledByAPixel/LittleJS / castShapeObject

Method castShapeObject

plugins/box2d.js:1916–1931  ·  view source on GitHub ↗

casts a box2d object to a shape type * @param {Object} o

(o)

Source from the content-addressed store, hash-verified

1914 /** casts a box2d object to a shape type
1915 * @param {Object} o */
1916 castShapeObject(o)
1917 {
1918 switch (o.GetType())
1919 {
1920 case box2d.instance.b2Shape.e_circle:
1921 return box2d.instance.castObject(o, box2d.instance.b2CircleShape);
1922 case box2d.instance.b2Shape.e_edge:
1923 return box2d.instance.castObject(o, box2d.instance.b2EdgeShape);
1924 case box2d.instance.b2Shape.e_polygon:
1925 return box2d.instance.castObject(o, box2d.instance.b2PolygonShape);
1926 case box2d.instance.b2Shape.e_chain:
1927 return box2d.instance.castObject(o, box2d.instance.b2ChainShape);
1928 }
1929
1930 ASSERT(false, 'Unknown box2d object type');
1931 }
1932
1933 /** casts a box2d object to a joint type
1934 * @param {Object} o */

Callers 2

drawFixturesMethod · 0.80
drawFixtureMethod · 0.80

Calls 1

ASSERTFunction · 0.50

Tested by

no test coverage detected