Search found 25 matches
- Sun Nov 05, 2017 5:24 pm
- Forum: Box2D tutorial discussion
- Topic: debug draw and polygon
- Replies: 15
- Views: 54155
Re: debug draw and polygon
i found but this is old code, the new version of Box2D a little differently for( b2Shape *shape = body->GetShapeList(); shape; shape = shape->GetNext() ) { if( shape->GetType() == e_polygonShape ) { b2PolygonShape *poly = (b2PolygonShape*)shape; int count = poly->GetVertexCount(); b2Vec2* verts = (b...
- Sun Nov 05, 2017 6:55 am
- Forum: Box2D tutorial discussion
- Topic: debug draw and polygon
- Replies: 15
- Views: 54155
debug draw and polygon
SDL_Point worldToPixel(b2Vec2 worldLocation) { SDL_Point p; p.x = worldLocation.x * SCALE - camera.x; p.y = worldLocation.y * SCALE - camera.y; return p; } void DrawPolygon(const b2Vec2* vertices, int32 vertexCount, const b2Color& color) { // RUBEScene* scene = getCurrentScene(); SDL_Renderer* ...
- Fri Oct 27, 2017 3:18 am
- Forum: R.U.B.E discussion
- Topic: chipmunk json loader
- Replies: 3
- Views: 19509
Re: chipmunk json loader
I try it but your code not for chipmunk 7.0!! I try to fix but it is hard for me.
Some func in your code not include 7.0
Some func in your code not include 7.0
- Wed Oct 25, 2017 4:38 pm
- Forum: R.U.B.E discussion
- Topic: chipmunk json loader
- Replies: 3
- Views: 19509
chipmunk json loader
HELLO !!! when download chipmunk json loader ??
- Mon Oct 16, 2017 3:47 pm
- Forum: Box2D tutorial discussion
- Topic: Rotation of an object in the other side
- Replies: 4
- Views: 23509
Re: Rotation of an object in the other side
https://wmpics.pics/di-DCLM.gif b2dJson jsonR; jsonR.readFromFile("obj/car_r.json", errorMsg, &World); b2dJson jsonL; jsonL.readFromFile("obj/car_l.json", errorMsg, &World); manipulation with ->SetActive(false); ->SetActive(true); and ->GetPosition(); ->GetAngle(); ->Get...
- Sat Oct 14, 2017 3:57 pm
- Forum: Box2D tutorial discussion
- Topic: Rotation of an object in the other side
- Replies: 4
- Views: 23509
Re: Rotation of an object in the other side
We Can take all the fixtures and replace them with other forms (shapes). Then take the connection information and recreate connections with recalculated data but will it be faster??? Loader Json makes this way of the files.
- Sat Oct 14, 2017 2:19 pm
- Forum: Box2D tutorial discussion
- Topic: Rotation of an object in the other side
- Replies: 4
- Views: 23509
Rotation of an object in the other side
I made two versions, one looks left the other looks right. Implemented a change of direction with the removal of the body and create a new one. But on low laptop the game freezes at the moment of reversal. How did you solved this problem? Maybe I need both versions of the body load while a second bo...
- Thu Oct 12, 2017 5:12 pm
- Forum: R.U.B.E discussion
- Topic: axes of coordinates R.U.B.E to box2d sdl2
- Replies: 9
- Views: 39748
Re: axes of coordinates R.U.B.E to box2d sdl2
BUT that would load the level will have to rotate them upside-down in the program R. U. B. E and turn on the X-axis
- Thu Oct 12, 2017 3:57 pm
- Forum: R.U.B.E discussion
- Topic: axes of coordinates R.U.B.E to box2d sdl2
- Replies: 9
- Views: 39748
Re: axes of coordinates R.U.B.E to box2d sdl2
I came out of the situation by making two versions of the body. One body, one facing left, another body is facing right, then turn them 180 ° and use loader json for C++, not SDL
and 2 question - answer - viewtopic.php?f=6&t=176
and 2 question - answer - viewtopic.php?f=6&t=176
- Mon Oct 09, 2017 3:12 am
- Forum: R.U.B.E discussion
- Topic: axes of coordinates R.U.B.E to box2d sdl2
- Replies: 9
- Views: 39748
Re: axes of coordinates R.U.B.E to box2d sdl2
No rotate... Need flip body, how it do