Search found 25 matches

by FLYNSXCOOL
Sun Nov 05, 2017 5:24 pm
Forum: Box2D tutorial discussion
Topic: debug draw and polygon
Replies: 15
Views: 53475

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...
by FLYNSXCOOL
Sun Nov 05, 2017 6:55 am
Forum: Box2D tutorial discussion
Topic: debug draw and polygon
Replies: 15
Views: 53475

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* ...
by FLYNSXCOOL
Fri Oct 27, 2017 3:18 am
Forum: R.U.B.E discussion
Topic: chipmunk json loader
Replies: 3
Views: 18921

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
by FLYNSXCOOL
Wed Oct 25, 2017 4:38 pm
Forum: R.U.B.E discussion
Topic: chipmunk json loader
Replies: 3
Views: 18921

chipmunk json loader

HELLO !!! when download chipmunk json loader ??
by FLYNSXCOOL
Mon Oct 16, 2017 3:47 pm
Forum: Box2D tutorial discussion
Topic: Rotation of an object in the other side
Replies: 4
Views: 23188

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...
by FLYNSXCOOL
Sat Oct 14, 2017 3:57 pm
Forum: Box2D tutorial discussion
Topic: Rotation of an object in the other side
Replies: 4
Views: 23188

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.
by FLYNSXCOOL
Sat Oct 14, 2017 2:19 pm
Forum: Box2D tutorial discussion
Topic: Rotation of an object in the other side
Replies: 4
Views: 23188

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...
by FLYNSXCOOL
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: 38806

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
by FLYNSXCOOL
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: 38806

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
by FLYNSXCOOL
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: 38806

Re: axes of coordinates R.U.B.E to box2d sdl2

No rotate... Need flip body, how it do