Jump to content

  • Log In with Google      Sign In   
  • Create Account

Fs02

Member Since 04 Feb 2013
Offline Last Active Oct 03 2014 06:42 AM

Topics I've Started

controlling chipmunk joints

01 July 2014 - 07:24 PM

Hello, i'm working on a project using cocos2d-js and chipmunk and gut stuck on how to control chipmunk joint, i'm very new on chipmunk physics but i've already familiar with box2d before.

I'm looking for example about how to manipulate chipmunk joints, not just how to create it but also how to control it, i've found some examples before but it just showing how to create a joint, not how to control it.
It'll be very helpfull if someone write an example or give a link to an example.

Thanks very much :-)

What do you thinks about Torque3D ?

20 December 2013 - 09:44 AM

i'm thinking to learn Torque3d because it licensed under MIT and i'd like to know what do you think ? or maybe another suggestion about another open source engine ? thank you :)


Why destructor is not called ?

27 April 2013 - 08:02 AM

Hi, i'm making a simple top down shooter game which have bullets entity, my problem is the bullet entity dtor is not called when i call the delete operator.

here's some of my code :

 

CBullet.hpp

namespace CEntity
{
	class CBullet
	{
	private:
		b2Body* m_Body;
	public:
		CBullet(b2World* world, const b2Vec2& normal, const b2Vec2& pos, float rot);
		~CBullet();
	};
}

 

CBullet.cpp

 

CEntity::CBullet::CBullet(b2World* world, const b2Vec2& normal, const b2Vec2& pos, float rot)
{
//
    fixDef.filter.categoryBits = CEntity::BULLET;
    m_Body->CreateFixture(&fixDef);
//
    m_Body->SetUserData(this);
    
}

CEntity::CBullet::~CBullet()
{
	m_Body->GetWorld()->DestroyBody(m_Body);
}

 

Cgun (responsible for creating the bullet with new operator)

 

void CEntity::CGun::shoot(const b2Vec2& normal, const b2Vec2& pos, float rot)
{
//
   new CEntity::CBullet(m_World, normal, pos, rot);
//
}

 

ContactListener (where the deletion should occur)

 

	void EndContact(b2Contact* contact)
	{
		b2Fixture* fixA		= contact->GetFixtureA();
		b2Fixture* fixB		= contact->GetFixtureB();
		
		if (fixA->GetFilterData().categoryBits	== CEntity::BULLET)
		{
			delete static_cast<CEntity::CBullet*>(fixA->GetUserData());
		}

		if (fixB->GetFilterData().categoryBits	== CEntity::BULLET)
		{
			delete static_cast<CEntity::CBullet*>(fixB->GetUserData());;
		}
	}

 

that's all, im using box2d by the way, any help would be apreciated :)

Surya 

 

PS: Sorry for my bad english


How do you manage two vector from two different api's(Box2D and SFML)

27 March 2013 - 09:31 AM

Hi, i'm using box2d and sfml and i have two different vector here (b2vec2 and sf::Vector2f).

 

I'm trying to combine two vector type in my game classes, what i've done now is making my own game vector utility whit all basic vector operation and casting ability to b2vec2 and sf::Vector2f and it's to far from efficient since i no longer able to pass the vector by pointer or refference and must pass it using value which expensive operation.

 

i'm also thinking about make b2vec2 as my global vector for game objects and create a converter for convert it to sfml if it needed sometime.

 

any advice or example's on how you manage this ?

 

thanks smile.png


Cegui crash on startup

12 March 2013 - 08:32 PM

Hi, im new at cegui and i want to integrating it to sfml. im using codeblocks with mingw gcc compiler

after almost 4 days research on google, i manage to compile a code but i get this error, don't know what happen but here is the error that shown in console

 

CEGUI::GenericException in file D:\CBLIB\CEGUI-0.7.9\cegui\src\CEGUIDynamicModul
e.cpp(128) : DynamicModule::DynamicModule - Failed to load module 'libCEGUIExpat
Parser': The specified module could not be found.

CEGUI Error: DynamicModule::DynamicModule - Failed to load module 'libCEGUIExpat
Parser': The specified module could not be found.

Error initializing application.
CEGUI::InvalidRequestException in file D:\CBLIB\CEGUI-0.7.9\cegui\src\RendererMo
dules\OpenGL\CEGUIOpenGLRenderer.cpp(147) : OpenGLRenderer::destroySystem: CEGUI
::System object is not created or was already destroyed.

This application has requested the Runtime to terminate it in an unusual way.
Please contact the application's support team for more information.

Process returned 3 (0x3)   execution time : 1.699 s
Press any key to continue.

 

 

thanks for anyone who could help me, im realy stuck here.


PARTNERS