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 5968683
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T20:07:29+00:00 2026-05-22T20:07:29+00:00

i am using spacemanager and i want to calculate the force with which the

  • 0

i am using spacemanager and i want to calculate the force with which the objects collide so that i can adjust the sounds and appropirate spirtes depending on the damage. can some one tell me how to calculate the forces. here is the code i got on this site.

if(!cpArbiterIsFirstContact(arb)) return;

cpFloat impulse = cpvlength(cpArbiterTotalImpulse(arb));

float volume = MIN(impulse/500.0f, 1.0f);
NSLog(@”impulse is :%f”,volume);

NSLog(@” impluse x:%f y:%f”, cpArbiterTotalImpulse(arb).x , cpArbiterTotalImpulse(arb).y);
if(volume > 0.05f){
[SimpleSound playSoundWithVolume:volume];
}

i have this in my POSTSOLVE method.i tried it in BEGIN aswell and all it prints is 0. i went through this site and found that i needs to do this.
smgr.space->elasticIterations = smgr.space->iterations;

even after doing the above , sometimes i get 1 and some times it says “nan”. is there something basic i need to know?

Thanks

  • 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-05-22T20:07:30+00:00Added an answer on May 22, 2026 at 8:07 pm

    From the documentation for cpArbiterTotalImpulse():

    Returns the impulse that was applied
    this step to resolve the collision.
    These functions should only be called
    from a postSolve() callback, otherwise
    the result is undefined.

    Note: If you
    are using the deprecated elastic
    iterations setting on your space, it
    will cause you to get incorrect
    results. Elastic iterations should no
    longer be needed, and you should be
    able to safely turn them off.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Using HTML 5, I want to play multiple sounds simultaneously. how can I do
Using Entity Framework 4 I want to create a base interface for my objects
Using a populated Table Type as the source for a TSQL-Merge. I want to
using this http://bl.ocks.org/950642 we can see how to add images to nodes, the question
Using Location.getBearing(); I seem to get randomly changing bearings. Aka, I can turn the
I'm trying to create a squishy ball with Cocos2d and Chipmunk (via SpaceManager) using
Using python I would like to monitor a .avi raw RGB video file that
Using Tsql, how can I find out when MS SQL server was installed?
Using C# How can I show a document in richtextbox without scrollbars, But I
I'm using Chipmunk physics and want to do collision detection to find out when

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.