playX / box2d

Automatically exported from code.google.com/p/box2d
0 stars 0 forks source link

Out of b2Timer and something else in PulleyJoint #245

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Hi,

I have windows 7 and I'm using VS2010 and
"#if defined(WIN32)" isn't detecting.

You can change it to "#if defined(WIN32) || defined(_WIN32)" because this it 
works.

In PulleyJoint can you add this function?

Declaration:
void SetRatioAndLength(float32 ratio, float32 lengthA, float32 lengthB);

Definition:
void b2PulleyJoint::SetRatioAndLength(float32 ratio, float32 lengthA, float32 
lengthB)
{
    m_lengthA = lengthA;
    m_lengthB = lengthB;

    b2Assert(ratio != 0.0f);
    m_ratio = ratio;

    m_constant = lengthA + m_ratio * lengthB;
}

Original issue reported on code.google.com by XoLaM...@gmail.com on 8 Sep 2011 at 10:06

GoogleCodeExporter commented 9 years ago
I changed the WIN32 define.

Why do you want to change the pulley length? This will probably not have the 
expected behavior because changing the length will not affect the velocity.

Original comment by erinca...@gmail.com on 17 Sep 2011 at 11:43

GoogleCodeExporter commented 9 years ago
I know.. But in other joints you can change everything. 
Something else for serialization: functions GetLengthA() and GetLengthB() not 
return maxLengthA and maxLengthB but actual distance. It is well but you could 
add set(or not)/get for maxLength values in PulleyJoint.

Original comment by XoLaM...@gmail.com on 18 Sep 2011 at 9:30

GoogleCodeExporter commented 9 years ago
Changing the length of a pulley joint is like changing the anchor points, and 
this is not allowed. The distance joint supports manipulation of the length, 
but that only works well if the joint is softened.

The pulley joint no longer has max length values.

Original comment by erinca...@gmail.com on 18 Sep 2011 at 5:11

GoogleCodeExporter commented 9 years ago
@"The pulley joint no longer has max length values."

Sorry, I was wrong, no max lenght but length.
GetLength not return lenght but return distance from anchor to body.
If you save it and load it a lenght will be wrong.

Meybe could you change GetLengthA/B to GetDistanceA/B and make correct function 
GetLengthA/B?

For set you are right.

Original comment by XoLaM...@gmail.com on 18 Sep 2011 at 6:10

GoogleCodeExporter commented 9 years ago
Command: Commit  
Modified: D:\Development\Box2D\Box2D\Box2D\Collision\b2BroadPhase.cpp  
Modified: D:\Development\Box2D\Box2D\Box2D\Common\b2Settings.cpp  
Modified: D:\Development\Box2D\Box2D\Box2D\Dynamics\Contacts\b2Contact.cpp  
Modified: D:\Development\Box2D\Box2D\Box2D\Dynamics\Contacts\b2Contact.h  
Modified: 
D:\Development\Box2D\Box2D\Box2D\Dynamics\Contacts\b2ContactSolver.cpp  
Modified: D:\Development\Box2D\Box2D\Box2D\Dynamics\Contacts\b2ContactSolver.h  
Modified: D:\Development\Box2D\Box2D\Box2D\Dynamics\Joints\b2PulleyJoint.cpp  
Modified: D:\Development\Box2D\Box2D\Box2D\Dynamics\Joints\b2PulleyJoint.h  
Modified: D:\Development\Box2D\Box2D\Build\vs2010\Testbed.vcxproj  
Modified: D:\Development\Box2D\Box2D\Build\vs2010\Testbed.vcxproj.filters  
Modified: D:\Development\Box2D\Box2D\CMakeLists.txt  
Modified: D:\Development\Box2D\Box2D\Documentation\manual.docx  
Adding: D:\Development\Box2D\Box2D\Testbed\Tests\ConveyorBelt.h  
Modified: D:\Development\Box2D\Box2D\Testbed\Tests\Gears.h  
Modified: D:\Development\Box2D\Box2D\Testbed\Tests\Pulleys.h  
Modified: D:\Development\Box2D\Box2D\Testbed\Tests\TestEntries.cpp  
Sending content: D:\Development\Box2D\Box2D\Testbed\Tests\Pulleys.h  
Sending content: D:\Development\Box2D\Box2D\Documentation\manual.docx  
Sending content: D:\Development\Box2D\Box2D\Testbed\Tests\Gears.h  
Sending content: 
D:\Development\Box2D\Box2D\Box2D\Dynamics\Joints\b2PulleyJoint.h  
Sending content: 
D:\Development\Box2D\Box2D\Build\vs2010\Testbed.vcxproj.filters  
Sending content: D:\Development\Box2D\Box2D\Testbed\Tests\TestEntries.cpp  
Sending content: D:\Development\Box2D\Box2D\Box2D\Collision\b2BroadPhase.cpp  
Sending content: D:\Development\Box2D\Box2D\Testbed\Tests\ConveyorBelt.h  
Sending content: 
D:\Development\Box2D\Box2D\Box2D\Dynamics\Contacts\b2ContactSolver.cpp  
Sending content: 
D:\Development\Box2D\Box2D\Box2D\Dynamics\Contacts\b2ContactSolver.h  
Sending content: 
D:\Development\Box2D\Box2D\Box2D\Dynamics\Contacts\b2Contact.cpp  
Sending content: D:\Development\Box2D\Box2D\Box2D\Dynamics\Contacts\b2Contact.h 

Sending content: D:\Development\Box2D\Box2D\Box2D\Common\b2Settings.cpp  
Sending content: D:\Development\Box2D\Box2D\CMakeLists.txt  
Sending content: D:\Development\Box2D\Box2D\Build\vs2010\Testbed.vcxproj  
Sending content: 
D:\Development\Box2D\Box2D\Box2D\Dynamics\Joints\b2PulleyJoint.cpp  
Completed: At revision: 238  

Original comment by erinca...@gmail.com on 14 Nov 2011 at 5:47