Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8922073
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T06:44:24+00:00 2026-06-15T06:44:24+00:00

The demo program is once slide the screen. The body (In my case, it

  • 0

The demo program is once slide the screen. The body (In my case, it is a blue cannon) will rotate correspondingly. So I defined a revolution joint for the cannon body and ground body, but seems the anchor is not setting correctly and lead to can’t rotate the body with mouse joint. “international practices”,I would upload related coding/screen next. Please see if you can help me.

Picture 1: Define related body,revolution joint

Picture 2: Touch callback function:Create mouse joint

Picture 3: Simulator screen(From the simulator,Seems the revolution anchor point is not correct)

I can’t upload image or post img links here due to lack of “reputation”, I have added the img links in myself comment .

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T06:44:25+00:00Added an answer on June 15, 2026 at 6:44 am

    First, when creating revolute joint you should use Initialize, like this:

    cannonJointDef.Initialize(groundBody, cannonBody, cannonBody->GetPosition());
    

    Last argument is anchor point in the world coordinates. In this case it will be the center of the cannon.

    Then, try to rotate cannon without mouseJoint, just by setting rotation directly:

    CGPoint touchVec = ccpSub(touchPos, _cannon.position);
    float angle = ccpToAngle(touchVec) - M_PI_2;
    cannonBody->SetTransform(cannonBody->GetPosition(), angle);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I created a simple WCF demo: Server Side: namespace ServerSide { class Program {
the following is a line from a python program that calls the demo.exe file.
Consider this demo program: #include <stdio.h> class Base { public: virtual int f(int) =0;
I am creating a sample demo program for make me understand that how can
I have been working on getting log4net working in a demo program for a
I have a simple program called demo.c which allocates space for a char array
I ran a demo bmp file format helper program DDDemo.exe to help me visualize
I want to write a jQuery file uploading program, using this plug-in http://aquantum-demo.appspot.com/file-upload Despite
A small demo program is included below. To reproduce the problem, select a date
I have this demo program which shows the concept of shift operator in java.But

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.