Jump to content

xtreampb

Members
  • Posts

    321
  • Joined

  • Last visited

Everything posted by xtreampb

  1. Right now just trying to get it to work i'm using the update physics call back, just trying to get anything to work. Yes i'm using xCode. I am just a novice but would a union work for you josh, or how about the new C++ 2011 standard. There is a new data type "auto" that may work. just throwing some things out there...
  2. Josh using the doc posted for object::addhook (link here http://www.leadwerks.com/werkspace/page/documentation/_/command-reference/object/objectaddhook-r759). My code now compiles but throws the above mentioned runtime error. MPC says this error needs to be fixed in the LE3 source code for OS X b/c it apprently works for windows according to rick.
  3. your example in the other thread is how to fix the bug in the source code...I don't have access to the source code. Admin posted an updated source code doc saying that should work. it does compile, but it now has a runtime error with the characteristics of the pointer not being initialized.
  4. per admin request here is my source code. my stone.cpp file where my issue is taking place void Coll (Entity* entity0)//, Entity* entity1, float* position, float* normal, float speed) { System::Print("Test"); } Stone::Stone() { this->Create(); } Stone::~Stone() { this->Release(); } void Stone::Create() { //load the models this->Full=Model::Load(MODEL_FOLDER + string("stone_1.mdl")); this->P1=Model::Load(MODEL_FOLDER + string("stone_1part01.mdl")); this->P2=Model::Load(MODEL_FOLDER + string("stone_1part02.mdl")); this->P3=Model::Load(MODEL_FOLDER + string("stone_1part03.mdl")); this->P4=Model::Load(MODEL_FOLDER + string("stone_1part04.mdl")); this->P5=Model::Load(MODEL_FOLDER + string("stone_1part05.mdl")); //this->Full->AddHook(<#const int hookid#>, <#void *hook#>); this->Full->AddHook(Entity::UpdatePhysicsHook, (void*)Coll); //set the phy shapes this->Full->SetShape(Shape::Load(MODEL_FOLDER + string("stone_1.phy"))); //this->P1->SetShape(Shape::Load(MODEL_FOLDER + string("stone_1part01.phy"))); //this->P2->SetShape(Shape::Load(MODEL_FOLDER + string("stone_1part02.phy"))); //this->P3->SetShape(Shape::Load(MODEL_FOLDER + string("stone_1part03.phy"))); //this->P4->SetShape(Shape::Load(MODEL_FOLDER + string("stone_1part04.phy"))); //this->P5->SetShape(Shape::Load(MODEL_FOLDER + string("stone_1part05.phy"))); //set the mass this->Full->SetMass(1); this->P1->SetMass(1); this->P2->SetMass(1); this->P3->SetMass(1); this->P4->SetMass(1); this->P5->SetMass(1); //hide the broken pieces this->P1->Hide(); this->P2->Hide(); this->P3->Hide(); this->P4->Hide(); this->P5->Hide(); } unsigned long Stone::Release() { this->Full->Release(); this->P1->Release(); this->P2->Release(); this->P3->Release(); this->P4->Release(); this->P5->Release(); return 0; } void Stone::SetPosition(Vec3 mPos) { this->Full->SetPosition(mPos); this->P1->SetPosition(mPos); this->P2->SetPosition(mPos); this->P3->SetPosition(mPos); this->P4->SetPosition(mPos); this->P5->SetPosition(mPos); } void Stone::SetRotation(Vec3 mRot) { this->Full->SetRotation(mRot); this->P1->SetRotation(mRot); this->P2->SetRotation(mRot); this->P3->SetRotation(mRot); this->P4->SetRotation(mRot); this->P5->SetRotation(mRot); } void Stone::Break()//Entity* entity0, Entity* entity1, float* position, float* normal, float speed) { this->Full->Hide(); this->P1->Show(); this->P2->Show(); this->P3->Show(); this->P4->Show(); this->P5->Show(); } my stone.h file #include "Leadwerks.h" using namespace Leadwerks; #ifndef Kings_Stone_h #define Kings_Stone_h class Stone { public: Stone(); ~Stone(); void Create();//leadwerks constructor unsigned long Release();//leadwerks deconstructor void SetPosition(Vec3); void SetRotation(Vec3); void Break(); //void __cdecl Break();//Entity* entity0, Entity* entity1, float* position, float* normal, float speed); private: //the models Model *Full; Model *P1; Model *P2; Model *P3; Model *P4; Model *P5; }; #endif and my App.cpp file #include "App.h" using namespace Leadwerks; App::App() : window(NULL), context(NULL), world(NULL), camera(NULL) {} App::~App() { delete world; delete window; } // #if defined (PLATFORM_WINDOWS) || defined (PLATFORM_MACOS) bool freelookmode=true; #else bool freelookmode=false; #endif bool App::Start() { //Create a window window = Window::Create("Kings"); //Create a context context = Context::Create(window); //Create a world world = World::Create(); //Create a camera camera = Camera::Create(); camera->Move(0,2,-5); camera->SetRotation(35,0,0); SpotLight *mLight=SpotLight::Create(); mLight->SetPosition(2,5,0); mLight->SetRange(10); mLight->SetColor(1.0, 1.0, 1.0); Stone *mStone=new Stone(); mStone->SetPosition(Vec3(0,10,0)); /*std::string mapname = System::GetProperty("map","Maps/Test.map"); Map::Load(mapname);*/ Model *ground=Model::Load("Models/CobbleBlock/Block_1.mdl"); ground->SetScale(10,.2,10); ground->SetPosition(0, -2, 0); ground->SetShape(Shape::Box()); mLight->Point(ground); //Hide the mouse cursor window->HideMouse(); //std::string mapname = System::GetProperty("map","Maps/start.map"); //Map::Load(mapname); //Move the mouse to the center of the screen window->SetMousePosition(context->GetWidth()/2,context->GetHeight()/2); return true; } bool App::Loop() { //Close the window to end the program if (window->Closed()) { return false; } //Press escape to end freelook mode if (window->KeyHit(Key::Escape)) { window->closed=true; } Time::Update(); world->Update(); world->Render(); context->Sync(false); return true; }
  5. I just fallowed the updated tutorial that the admin linked to me in a chat (found here: http://www.leadwerks.com/werkspace/page/documentation/_/command-reference/object/objectaddhook-r759) It compiles, but at run time throws the fallowing error: EXC_BAD_ACCESS(code=2, address=0x0) Anyone got any advice from here?
  6. So apprently there is an error in the source code for adding hooks via the Entity::AddHook function for OS X. For more information please fallow the detailed thread listed below. http://www.leadwerks.com/werkspace/topic/6361-le3-collisions-hook/
  7. Thank you josh, @Rick I have ran the game but again like Josh said, OS X doesn't do any thing with exe. So if i make a game solely for OS X and don't have a windows machine to build on, then i'm kinda outta luck. I know that there are tools such as mingw but i shouldn't have to use these tools
  8. so if type casting a void pointer to a function...how do i do that. I tried static_cast, dynamic_cast and reinterpret_cast. Also the implicit casts didn't work.
  9. When attempting to publish any game listed in the project manager an error window appears and says "Failed to publish project" i then open the editor of the project and says in the log: /Applications/Leadwerks/Projects/(Project name, Darkness Awaits in this case) Error: The project executable "Project Name, Darkness Awaits in this case).exe" was not found. I'm using OS X. The project manager shouldn't even be looking for an exe to publish if i'm on a Mac. The option could be enabled for people who are using mingw or some other similar tool. But the lack of an exe shouldn't stop the publishing for mac OS X
  10. When creating a new project i attempt to build the iOS version of the Darkness awakes in the xcode project. I'm using xCode version 4.6.1. The error i'm getting is this: error: /Applications/Leadwerks/Projects/DarknessAwaits/Projects/iOS/data.zip: No such file or directory the information associated with the error is: CpResource data.zip /Users/xtreampb/Library/Developer/Xcode/DerivedData/DarknessAwaits-bkjudgfjrtsrnwhhyzewwncqlxaq/Build/Products/Debug-iphonesimulator/DarknessAwaits.app/data.zip cd /Applications/Leadwerks/Projects/DarknessAwaits/Projects/iOS setenv PATH "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin" builtin-copy -exclude .DS_Store -exclude CVS -exclude .svn -exclude .git -exclude .hg -resolve-src-symlinks /Applications/Leadwerks/Projects/DarknessAwaits/Projects/iOS/data.zip /Users/xtreampb/Library/Developer/Xcode/DerivedData/DarknessAwaits-bkjudgfjrtsrnwhhyzewwncqlxaq/Build/Products/Debug-iphonesimulator/DarknessAwaits.app I have followed the path and there is no data.zip. there is a data folder but no zip folder. also i don't know if this is related but i also get this warning: directory not found for option '-L/Applications/Leadwerks/Engine/Library/iOS i fallowed that path and in the Library folder it has iphoneos, iphonesimulator, MacOS, Windows, and Android.
  11. so yea didn't work, wouldn't compile. Yes OS X uses GCC. So i did some funny things. I'm not even sure what i did but this compiles... void (*Coll)//, Entity* entity1, float* position, float* normal, float speed) { }; this->Full->AddHook(Entity::UpdatePhysicsHook, Coll); however when the add hook is hit durring runtime it throws the following error EXC_BAD_ACCESS(code=2, address=0x0) So I have this pointer of a function that isn't initialized. So now i need to initialize my Coll function some how I believe. Can some one explain to me what i have done? Per your requested admin. My code as it stands now. my cpp file #include "Stone.h" #define MODEL_FOLDER "Models/Stone/" //Collisions Function void (*Coll)//, Entity* entity1, float* position, float* normal, float speed) { }; /*void mColl() { }*/ Stone::Stone() { this->Create(); } Stone::~Stone() { this->Release(); } void Stone::Create() { //load the models this->Full=Model::Load(MODEL_FOLDER + string("stone_1.mdl")); this->P1=Model::Load(MODEL_FOLDER + string("stone_1part01.mdl")); this->P2=Model::Load(MODEL_FOLDER + string("stone_1part02.mdl")); this->P3=Model::Load(MODEL_FOLDER + string("stone_1part03.mdl")); this->P4=Model::Load(MODEL_FOLDER + string("stone_1part04.mdl")); this->P5=Model::Load(MODEL_FOLDER + string("stone_1part05.mdl")); //this->Full->AddHook(<#const int hookid#>, <#void *hook#>); this->Full->AddHook(Entity::UpdatePhysicsHook, Coll); //set the phy shapes this->Full->SetShape(Shape::Load(MODEL_FOLDER + string("stone_1.phy"))); //this->P1->SetShape(Shape::Load(MODEL_FOLDER + string("stone_1part01.phy"))); //this->P2->SetShape(Shape::Load(MODEL_FOLDER + string("stone_1part02.phy"))); //this->P3->SetShape(Shape::Load(MODEL_FOLDER + string("stone_1part03.phy"))); //this->P4->SetShape(Shape::Load(MODEL_FOLDER + string("stone_1part04.phy"))); //this->P5->SetShape(Shape::Load(MODEL_FOLDER + string("stone_1part05.phy"))); //set the mass this->Full->SetMass(1); this->P1->SetMass(1); this->P2->SetMass(1); this->P3->SetMass(1); this->P4->SetMass(1); this->P5->SetMass(1); //hide the broken pieces this->P1->Hide(); this->P2->Hide(); this->P3->Hide(); this->P4->Hide(); this->P5->Hide(); } unsigned long Stone::Release() { this->Full->Release(); this->P1->Release(); this->P2->Release(); this->P3->Release(); this->P4->Release(); this->P5->Release(); return 0; } void Stone::SetPosition(Vec3 mPos) { this->Full->SetPosition(mPos); this->P1->SetPosition(mPos); this->P2->SetPosition(mPos); this->P3->SetPosition(mPos); this->P4->SetPosition(mPos); this->P5->SetPosition(mPos); } void Stone::SetRotation(Vec3 mRot) { this->Full->SetRotation(mRot); this->P1->SetRotation(mRot); this->P2->SetRotation(mRot); this->P3->SetRotation(mRot); this->P4->SetRotation(mRot); this->P5->SetRotation(mRot); } void Stone::Break()//Entity* entity0, Entity* entity1, float* position, float* normal, float speed) { this->Full->Hide(); this->P1->Show(); this->P2->Show(); this->P3->Show(); this->P4->Show(); this->P5->Show(); } my .h code #include "Leadwerks.h" using namespace Leadwerks; #ifndef Kings_Stone_h #define Kings_Stone_h class Stone { public: Stone(); ~Stone(); void Create();//leadwerks constructor unsigned long Release();//leadwerks deconstructor void SetPosition(Vec3); void SetRotation(Vec3); void Break(); //void __cdecl Break();//Entity* entity0, Entity* entity1, float* position, float* normal, float speed); private: //the models Model *Full; Model *P1; Model *P2; Model *P3; Model *P4; Model *P5; }; #endif
  12. i'm having some issues with iOS builds. Should i post a new bug?
  13. so is this an OSX bug that josh needs to fix and i need to wait on or what? Also i have seen a bunch of different things (maybe it is all the same but i can't tell). What should I do? can anyone post a working work around with my code until the bug is fixed please. Lastly do i need to report this as a bug in the bug reporting section?
  14. this is what i got in my CPP file void Coll(Entity* entity0)//, Entity* entity1, float* position, float* normal, float speed) { } this->Full->AddHook(Entity::UpdatePhysicsHook, Coll); i switched to the update physics hook to emulate what is in the linked thread and still getting the fallowing error "cannot initialize a paramater of type 'void *' with an lvalue of type 'void (Leadwerks::Entity *)'
  15. yes i have removed the prototype completely
  16. ok so i removed the prototype from my header and added it to the top of my CPP file. Still getting an error. I'm using OSX if that makes a difference.
  17. yes that is correct as well as Full.
  18. hey all i'm trying to add a collisions hook. Can someone help me with what i'm doing wrong //.h file void Break(Entity* entity0, Entity* entity1, float* position, float* normal, float speed); //CPP file this->Full->AddHook(Entity::CollisionHook, *Break)//my entity and adding the hook to my entity void Stone::Break(Entity* entity0, Entity* entity1, float* position, float* normal, float speed) { this->Full->Hide(); //blah blah blah } thank you for your help, ~Xtreampb~
  19. Silly me. Went and double checked the document reference. CPP file needs to be this->ModelName=Model::Load("myPath");
  20. Hey all, I like to do all my games in pure C++. With that said i seam to be having an issue with create my own object. My object is basically 6 models. In my header file, if I create them with as a pointer then use the load, if i try to do anything else with them such as Hide() it throws a bad access error, as if it was never stored in memory, or the mem address was lost. If i create them as a normal var, no issues. No issues that is until i try to terminate the problem. then it frees my object then tries to free it a second time, of course crashing the program saying that it tried to free an unallocated memory address. Anyone got any suggestions Thank you, Xtreampb
  21. YouGrove, my demo, Castle Defense, everything is created at run time. the wall is created and everytime a sone is thrown, the stone and all the smaller borken pieces are created on the spot. It only starts to slow down b/c i don't clean up all the broken pieces laying on the ground.
  22. Using OS X 8.3 When modifying a material (texture is already applied to MDL file in my situation), upon saving the file, the entire editor crashes. Upon reopen, the material was successfully saved.
  23. Using Mac OS X 8.3 When importing assets (GMF objects in my situation), the LE3 editor shows 2 copies of the object. A reload solves this issue.
  24. Using Mac OSX 8.3 When creating a new folder or asset (such as material), the typed name doesn't show in the editor tree. It displays the default name. When I try to rename the newly created object, it fails stating that it can change the name. When looking at the object in the file system, it shows the proper name (the name i typed in). A reload fixes this. This is more of a nuisance than anything.
×
×
  • Create New...