-
Notifications
You must be signed in to change notification settings - Fork 639
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bind functions into b2Joint, and make Joints inherited from b2Joint #91
base: master
Are you sure you want to change the base?
Conversation
arr[1] = force.y; | ||
} | ||
double b2Joint_GetReactionTorque(void* joint, double inv_dt) { | ||
return ((b2Joint*)joint)->GetReactionTorque(inv_dt); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indent seems to be 4 spaces here and below, whereas its 2 elsewhere
/**@constructor*/ | ||
function b2DistanceJoint(def) { | ||
b2Joint.call(this, def); | ||
} | ||
b2DistanceJoint.prototype = Object.create(b2Joint.prototype); | ||
b2DistanceJoint.prototype.constructor = b2DistanceJoint; | ||
|
||
b2DistanceJoint.prototype.SetLength = function(length) { | ||
b2DistanceJointDef_SetLength(this.prt, length); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same thing, inconsistent indentation here.
Can you squash this down to a single commit? Generally looks good, but I want to get at least one more pair of eyes on it before I approve it. One thing I did notice is that in some files the indentation is inconsistent. Some places use two spaces for indentation, some use 4. Can you fix these? I marked some of them, but check other files for inconsistencies too. |
1. add b2Joint.GetType() 1. add b2Joint.GetAnchorA() 1. add b2Joint.GetAnchorB() - move bodyA/bodyB into b2Joint as source C does it. - add GetReactionForce() - add GetReactionTorque() - add IsActive() - add GetCollideConnected() make up b2DistanceJoint methods make up b2FrictionJoint methods make up b2GearJoint methods. make up b2MtorJoint methods make up b2MouseJoint methods make up b2PrismaticJoint methods make up b2PulleyJoint methods make up b2RevoluteJoint methods make up b2RopeJoint methods add limit_state enums make up b2WeldJoint methods make up b2WheelJoint methods change indents to 2 spaces
I think i successfully squashed to one commit ( i am a git newbie) |
void b2Body_SetLinearDamping(void* body, double linearDamping); double b2Body_GetLinearDamping(void* body); void b2Body_SetAngularDamping(void* body, double angularDamping); double b2Body_GetAngularDamping(void* body); bool b2Body_IsAwake(void* body); void b2Body_SetBullet(void* body, double flag); bool b2Body_IsBullet(void* body); void b2Body_SetSleepingAllowed(void* body, double flag); bool b2Body_IsSleepingAllowed(void* body); void b2Body_SetActive(void* body, double flag); bool b2Body_IsActive(void* body); bool boBody_IsFixedRotation(void* body);
I have been trying to build the latest codebase using current emscripten toolchain (on Chromebook, via emsdk, including "emsdk install fastcomp-clang-e1.38.31-64bit" since liquidfun docs ask for fastcomp). I was hoping for wasm rather than js, eventually, but initial challenge is to get anything built: A naive attempt fails with
Since googling for "_b2GearJointDef_InitializeAndCreate" finds exactly one hit - this PR - it seemed worth mentioning here. |
I should add that https://github.com/haskasu/liquidfun gives me the same emcc build error; as does liquidfun-1.1.0.zip. Despite the error, an "lf_core.wasm" (size 234940) does get produced. |
in order to debugDraw joints in lfjs, we need to add GetAnchorA() and GetAnchorB() functions in all b2Joints
So what this pr does are: