Box2d (4)-dumpshell in cocos2d-x

Source: Internet
Author: User

Small man (Bill man) Personal Original, welcome to reprint, reprint please indicate the address, small man (Bill man) column address http://blog.csdn.net/bill_man

The dumpshell example is mainly used to create two types of joints: Moving and rotating.

Below is

There is nothing special about defining objects. The linespeed is represented by the linearvelocity of the b2vec2 type, the angularvelocity of the float type is used to represent the angular velocity, and the linear damping is represented by the lineardamping of the float type, angulardamping, a float-type angulardamping, is used to indicate the angular impedance. allowsleep, A bool-type, is used to indicate whether sleep is allowed, as shown in

The following describes how to create a moving joint and a rotating joint. First, the distance from the joint is defined as follows. The moving joint allows two objects to move relative to the specified axis without rotation and has only one degree of freedom.

The following is a moving joint. Two objects share one anchor and have only one degree of freedom, that is, they rotate each other.

It is worth noting that both define the motor and specify the maximum torque for the motor. The motor will maintain the specified speed unless the force exceeds the maximum torque.

If there are any errors, I hope you can correct them more.

Next, let's write a gears example.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.