I need some help using Box2D's DebugDraw feature. I don't know what I'm doing wrong... but I've tried every example online and it just doesn't seem to work for me. I can't see any shapes.
I can compile and run the Box2D TEstbed and can see the objects so I know it's possible.
Basically what I am looking for is:
* Simple HelloWorld (nothing fancy) type example with just a simple shape
* Utilizes cocos2d-x and Box2D
* Builds and runs on Windows (I'm using VisualStudio 2012)
If you can whip up and share something like this, I would be forever gratefull. I've spent all week on this have haven't made an progress. :(
Thanks!!!
Which version of cocos2dx are you using? If v2 you can clone and add this b2Draw implementation to your project.
Add the box2d debug layer with the following snippet to your scene.
B2DebugDrawLayer *debugdraw = B2DebugDrawLayer::create(mWorld, DEBUG_PTM_RATIO);
addChild(debugdraw)
Optionally you could enable more box2d debug flags in B2DebugDrawLayer::init.
Related
Okay so I've been using OpenCV and want to use it for IOS with Swift 2.0... I successfully implemented it and I tested it with a few functions/examples, it worked fine! But The application in thought I have is a Live Camera object detection. So using a cascade classifier I will do this, but the thing I have trouble with is setting up the CvVideoCameraDelegate protocol with my ViewController; I'm trying to use this tutrial/example to set it up....
But I'm having trouble trying to set it up in swift.... Can someone please advise the correct way to set it up?
The tutorial you are referencing is about how to do this in Objective-C. Doing it in Swift is a little trickier. You will need to set up an Objective-C class as the camera's delegate, and your Swift code will have to communicate with the CvVideoCamera object via this Objective-C class and possibly other helper Objective-C classes. Please see this question/answer: Video processing with OpenCV in IOS Swift project
Although I know how to create a VST plugin today, I still don't understand the GUI part of it.
I've been playing around with Steinbergs samples and what I can see is that they are using some default sliders in the exapmles, but am I supposed to use these when designing my own and apply some graphics to them? Or should I create my own completly? How should I think around the GUI approach to make the GUI code also work for both PC and MAC later on?
I've been searching my rearbehind off but can't find anything about these questions anywhere. Please give my a lead or guide me to the light so I can grow my hair back.
How should I think around the GUI approach to make the GUI code also
work for both PC and MAC later on?
If that is your ultimate goal, then I strongly suggest you check out the JUCE library. The plugin wrappers are very good and it is completely cross-platform.
The new Unreal Engine 4 is able to change the game logic at runtime. For example you can jump into the game, change some game logic and once it is recompiled it will be updated in the game itself.
I was wondering how they did it?
My first idea was that they separate their game logic to a .dll and then they are just reloading/injecting it at runtime. But I also know that .dlls are windows specific. I think the equivalent in linux is called .elf.
What alternatives are there?
I also know that there is a c++ interpreter available but I think the newer version uses a jit compiler now. Would this help me in any way?
I hope you can clear things up for me.
Unreal Engine does this by using Hot Reload which basically (re)compiles the source code that has been changed and reloads it back into game. The game will be in a paused state while compilation is taking place.
This presentation goes into more detail about the technique.
I have access to both OSX and Windows. I have built my demo in Visual Studio 2010 using C++ and DirectX 10. I have read that C++ can be run on the iPhone using XCode, but that any input has to handled in objective-c.
At present there is no input so that's not an issue right now.
What are the steps I would have to take to get it running on the iPhone?
also - was not quite sure how to tag this question. by all means edit them if they're wrong.
Yes, you can run C++ code fine on an iPhone. I've released a couple games which have a large C++ component. Of course, the graphics will need to be redone.
Likely you'll need a little bit of Objective-C++ code to communicate between the UI layer and the underlying engine.
There's no DirectX on iOS (being that it's made by Microsoft) so any code that calls DirectX is going to need to be ported over to something that can be run on iOS, like OpenGL.
Other than that you'll be treating your code like a library. With a layer of objective-c that sets up the app, and calls the necessary parts of your C++ code.
Good Day
I want to start a opengl project, mainly to follow the Nehe tutorials.
My problem is that I only see templates for opengl es for iphone, and when I click build on those, I only have the choice between iphone or ipad simulator.
So How can I get started with a simple opengl template to follow the tutorial series, without using a simulator, but executing it natively on my mac osx lion?
Please give me a step by step instruction if possible :)
I looked around everywhere but all I found were instructions for Xcode 3 and below etc.
Any help would be appreciated
Create a normal Cocoa project, add the OpenGL framework. In your main window add a NSOpenGLView.
http://developer.apple.com/devcenter/mac/resources/opengl/
I am currently in the process of writing an intuitive Xcode 4 Template for an OpenGL Mac application, which I think is exactly what you were wanting.
In the mean time, you can look at this, a Pong clone I made in OpenGL on the Mac, done the proper way.
EDIT: The template isn't completely finished, but it's definately usable. I didn't implemenet the 3D option, so picking that in the dropdown will result in blank files.
Donwload it from here and then move it into the ~/Library/Developer/Xcode/Templates/Project Templates/Applications folder in your user director.