Topic:   SC Physics   (Read 56297 times)


0 Members and 1 Guest are viewing this topic.

Gan


  • Administrator

  • ^ This guy is amazing.

  • *****


  • Posts: 4411
SC Physics
« on: January 30, 2011, 10:37:53 AM »
« Last Edit: February 26, 2011, 12:28:54 PM by Gandolf »

WarHampster


  • GMG Extraordinaire

  • ***


  • Posts: 1501

  • The People's Moderator
    • Arcade of the Absurd
Re: SC Physics
« Reply #1 on: January 30, 2011, 10:41:20 AM »
Cool, is this working through your box2d integration idea?

Gan


  • Administrator

  • ^ This guy is amazing.

  • *****


  • Posts: 4411
Re: SC Physics
« Reply #2 on: January 30, 2011, 10:44:43 AM »
Yeah. I was thinking Sc needed a built in physics engine and Mike's so busy so I went ahead and built a plugin.

WarHampster


  • GMG Extraordinaire

  • ***


  • Posts: 1501

  • The People's Moderator
    • Arcade of the Absurd
Re: SC Physics
« Reply #3 on: January 30, 2011, 10:55:23 AM »
So there's a second program running alongside the SC program?


Gan


  • Administrator

  • ^ This guy is amazing.

  • *****


  • Posts: 4411
Re: SC Physics
« Reply #4 on: January 30, 2011, 12:20:28 PM »
Yeah. I built an invisible Obj-C application that runs the physics simulation and feeds the results to Sc. Sc controls the input, game, and drawing. The SCBox2D plugin handles the logic.

If I can find the code to open an external application I can make Sc automatically start the plugin so the player has no idea a second application is running.

EqwanoX


  • Administrator

  • GMG Extraordinaire

  • *****


  • Posts: 1180
Re: SC Physics
« Reply #5 on: January 30, 2011, 01:07:57 PM »
wiat what?! thats not even possible, is there any sc coding involved at all? does it simply just display the action on the sc canvas?

Gan


  • Administrator

  • ^ This guy is amazing.

  • *****


  • Posts: 4411
Re: SC Physics
« Reply #6 on: January 30, 2011, 01:30:10 PM »
It's possible and I've done it. It uses plain Sc code to control the plugin.

After I clean it up and make it more user friendly I'll post the source so you guys can play. Right now it only supports making circles and squares and moving things with the mouse. Eventually you'll be able to control gravity, specify friction/density/mass/restitution, set the level boundaries, and have joints. Though baby steps.

Gan


  • Administrator

  • ^ This guy is amazing.

  • *****


  • Posts: 4411
Re: SC Physics
« Reply #7 on: January 30, 2011, 03:05:01 PM »
Download in first post.

That's it. To run double click the SCBox2D plugin. Then open the Sc source and play around.
I just compiled the plugin for 10.5+.

P.S. After many tries at converting code and compiling, I could not get the plugin to run on my old 10.4 powerbook G3. So I'm just going to stick with 10.5+.
« Last Edit: January 30, 2011, 05:46:43 PM by Gandolf »

Gan


  • Administrator

  • ^ This guy is amazing.

  • *****


  • Posts: 4411
Re: SC Physics
« Reply #8 on: January 30, 2011, 05:45:46 PM »
I've just optimized the engine so it can handle a lot more objects on screen.

WarHampster


  • GMG Extraordinaire

  • ***


  • Posts: 1501

  • The People's Moderator
    • Arcade of the Absurd
Re: SC Physics
« Reply #9 on: January 30, 2011, 10:52:16 PM »
Quote
wiat what?! thats not even possible


GAN IS A WITCH!!!

This is awesome, although I'm kind of paranoid about that second program lurking in the shadows after I close the SC program.

x


  • GMG-er

  • **


  • Posts: 247
Re: SC Physics
« Reply #10 on: January 30, 2011, 11:56:01 PM »
This is great, nicely done!

I guess one could theoretically write a simple openGL based rendering engine app and script it in SC using methods. Given that SC has a way too give focus to another app/window (does it?). Or perhaps the app could produce a simple .bmp file with the rendered scene that SC reads as a sprite.

Ok I am done speculating now lol.

Gan


  • Administrator

  • ^ This guy is amazing.

  • *****


  • Posts: 4411
Re: SC Physics
« Reply #11 on: January 31, 2011, 10:53:51 AM »
Quote
GAN IS A WITCH!!!
SHHHH!! Those salem creeps are still after me!

Quote
This is awesome, although I'm kind of paranoid about that second program lurking in the shadows after I close the SC program.
Don't worry. The program automatically quits after 5 minutes of inactivity. And key logging and erasing random files.

Quote
This is great, nicely done!
 
I guess one could theoretically write a simple openGL based rendering engine app and script it in SC using methods. Given that SC has a way too give focus to another app/window (does it?). Or perhaps the app could produce a simple .bmp file with the rendered scene that SC reads as a sprite.
 
Ok I am done speculating now lol.
Sc won't accept a bmp. It probably could be done if the Gl renderer could identify Sc's canvas and draw over the top of it. But it'd be quite a challenge to write something like that.

WarHampster


  • GMG Extraordinaire

  • ***


  • Posts: 1501

  • The People's Moderator
    • Arcade of the Absurd
Re: SC Physics
« Reply #12 on: January 31, 2011, 11:03:05 AM »
I thought about this for my SC3D implementation. Conclusion: not worth it.

EqwanoX


  • Administrator

  • GMG Extraordinaire

  • *****


  • Posts: 1180
Re: SC Physics
« Reply #13 on: January 31, 2011, 11:17:33 AM »
how does this work in sc code? can you do a quick tutorial? and can you do it with a mic, its annoying waiting for you to type out what your saying.

Gan


  • Administrator

  • ^ This guy is amazing.

  • *****


  • Posts: 4411
Re: SC Physics
« Reply #14 on: January 31, 2011, 12:21:55 PM »
Download & Tutorial up above.

I added a crap load of new features. Make sure to try out the SCBox2D testbed, some really cool stuff.
Here's a voice tutorial on it. Enjoy.
« Last Edit: January 31, 2011, 04:05:41 PM by Gandolf »