Sammy6200
-
Posts
12 -
Joined
-
Last visited
Content Type
Blogs
Forums
Store
Gallery
Videos
Posts posted by Sammy6200
-
-
it seems to be an error with the following:
inline void RegisterAbstractPath(str path)
{
leRegisterAbstractPath(path);
}
-
My solution was this:
#include "engine.h"#include <iostream>#include <cmath>int main( int argn, char* argv[] ){Initialize() ;RegisterAbstractPath("C:/Users/Sammy/Desktop/Leadwerks SDK");SetAppTitle( "New" ) ;Graphics( 800, 500 ) ;AFilter() ;TFilter() ;TWorld world;TBuffer gbuffer;TCamera camera;TMesh mesh;TBody body;TMesh mesh2;TBody body2;TLight light;TMaterial material;world = CreateWorld() ;if (!world) {MessageBoxA(0,"Error","Failed to create world.",0);return Terminate();}gbuffer=CreateBuffer(GraphicsWidth(),GraphicsHeight(),BUFFER_COLOR|BUFFER_DEPTH|BUFFER_NORMAL);camera=CreateCamera();PositionEntity(camera,Vec3(0,0,-2));mesh=CreateSphere(16);body=CreateBodySphere();EntityParent(mesh,body);SetBodyMass(body,1);EntityType(body,1);PositionEntity(body,Vec3(-0.8,0,0));mesh2=CreateSphere(16);body2=CreateBodySphere();EntityParent(mesh2,body2);SetBodyMass(body2,1);EntityType(body2,1);PositionEntity(body2,Vec3(0.2,0,0));DebugPhysics(1);light=CreateDirectionalLight();RotateEntity(light,Vec3(45,45,45));Collisions(1,1,1);SetWorldGravity(Vec3(0,0,0));TVec3 b1Vec = Vec3(0,0,0);TVec3 b2Vec = Vec3(0,0,0);TVec3 fVec = Vec3(0,0,0);// Game loopwhile( !KeyHit() && !AppTerminate() ){b1Vec = EntityPosition(body);b2Vec = EntityPosition(body2);fVec = Vec3((b1Vec.X - b2Vec.X)*(-1), (b1Vec.Y - b2Vec.Y)*(-1), (b1Vec.Z - b2Vec.Z)*(-1));AddBodyForce(body,fVec);if(KeyDown(KEY_UP)){AddBodyForce(body,Vec3(0,10,0));}if(KeyDown(KEY_DOWN)){AddBodyForce(body,Vec3(0,-10,0));}// Update timing and worldUpdateAppTime();UpdateWorld(AppSpeed()) ;// RenderSetBuffer(gbuffer);RenderWorld();SetBuffer(BackBuffer());RenderLights(gbuffer);// Send to screenFlip(0) ;}// Donereturn Terminate() ;}And it works perfectly!
-
I get this error:
'NewNew-Debug.exe': Loaded 'C:\Users\Sammy\Desktop\NewNew-Debug.exe', Symbols loaded.'NewNew-Debug.exe': Loaded 'C:\Windows\System32\ntdll.dll''NewNew-Debug.exe': Loaded 'C:\Windows\System32\kernel32.dll''NewNew-Debug.exe': Loaded 'C:\Windows\System32\KernelBase.dll''NewNew-Debug.exe': Loaded 'C:\Windows\System32\user32.dll''NewNew-Debug.exe': Loaded 'C:\Windows\System32\gdi32.dll''NewNew-Debug.exe': Loaded 'C:\Windows\System32\lpk.dll''NewNew-Debug.exe': Loaded 'C:\Windows\System32\usp10.dll''NewNew-Debug.exe': Loaded 'C:\Windows\System32\msvcrt.dll''NewNew-Debug.exe': Loaded 'C:\Windows\winsxs\x86_microsoft.vc90.debugcrt_1fc8b3b9a1e18e3b_9.0.30729.1_none_bb1f6aa1308c35eb\msvcr90d.dll''NewNew-Debug.exe': Loaded 'C:\Windows\winsxs\x86_microsoft.vc90.debugcrt_1fc8b3b9a1e18e3b_9.0.30729.1_none_bb1f6aa1308c35eb\msvcp90d.dll''NewNew-Debug.exe': Loaded 'C:\Windows\System32\imm32.dll''NewNew-Debug.exe': Loaded 'C:\Windows\System32\msctf.dll'First-chance exception at 0x00000000 in NewNew-Debug.exe: 0xC0000005: Access violation.Unhandled exception at 0x00000000 in NewNew-Debug.exe: 0xC0000005: Access violation.The program '[3604] NewNew-Debug.exe: Native' has exited with code -1073741819 (0xc0000005).When im trying to compile a leadwerks program.
The weird thing is that it works perfectly when compiled for the first time, but as soon as i close ("Visual C++ Express"), start it up again and compile the error suddenly appears.
- When i create a new project and copy/paste the code, it works again, but when i close and restart the compiler theres the same error again.
I dont get it, and it's driving me crazy.
Additional info:
Engine.logLeadwerks Engine 2.24Initializing Renderer...OpenGL Version: 2.1.8787GLSL Version: 1.30Render device: ATI Radeon HD 3200 GraphicsVendor: ATI Technologies Inc.DrawBuffers2 supported: 016 texture units supported.GPU instancing supported: 0Shader model 4.0 supported: 1Loading shader "zip::c:/users/sammy/desktop/leadwerks sdk/shaders.pak//query.vert", ""...Loading shader "zip::c:/users/sammy/desktop/leadwerks sdk/shaders.pak//mesh/mesh_shadow.vert", ""...Loading shader "zip::c:/users/sammy/desktop/leadwerks sdk/shaders.pak//guide.vert", "zip::c:/users/sammy/desktop/leadwerks sdk/shaders.pak//guide.frag"...Loading shader "zip::c:/users/sammy/desktop/leadwerks sdk/shaders.pak//mesh/mesh.vert", "zip::c:/users/sammy/desktop/leadwerks sdk/shaders.pak//mesh/mesh.frag"...Loading shader "zip::c:/users/sammy/desktop/leadwerks sdk/shaders.pak//postfilters/postfilter.vert", "zip::c:/users/sammy/desktop/leadwerks sdk/shaders.pak//postfilters/depthblit.frag"...Loading texture "incbin::noise.dds"...Loading shader "zip::c:/users/sammy/desktop/leadwerks sdk/shaders.pak//postfilters/postfilter.vert", "zip::c:/users/sammy/desktop/leadwerks sdk/shaders.pak//lighting/directionallight.frag"... -
Thanks!
-
I got an idea. Can anyone tell me how to get the position of an object? Is there any "GetPosition()" function, that can return the position of a body?
-
I still can't figure out how to do it
-
I did this:
#include "engine.h"
#include <iostream>
int main( int argn, char* argv[] )
{
Initialize() ;
RegisterAbstractPath("C:/Users/Sammy/Desktop/Leadwerks SDK");
SetAppTitle( "New" ) ;
Graphics( 800, 500 ) ;
AFilter() ;
TFilter() ;
TWorld world;
TBuffer gbuffer;
TCamera camera;
TMesh mesh;
TBody body;
TMesh mesh2;
TBody body2;
TLight light;
TMaterial material;
world = CreateWorld() ;
if (!world) {
MessageBoxA(0,"Error","Failed to create world.",0);
return Terminate();
}
gbuffer=CreateBuffer(GraphicsWidth(),GraphicsHeight(),BUFFER_COLOR|BUFFER_DEPTH|BUFFER_NORMAL);
camera=CreateCamera();
PositionEntity(camera,Vec3(0,0,-2));
material=LoadMaterial("abstract::cobblestones.mat");
mesh=CreateSphere(16);
body=CreateBodySphere();
EntityParent(mesh,body);
PaintEntity(mesh,material);
SetBodyMass(body,1);
EntityType(body,1);
PositionEntity(body,Vec3(0.7,0.5,0.3));
mesh2=CreateSphere(16);
body2=CreateBodySphere();
EntityParent(mesh2,body2);
PaintEntity(mesh2,material);
EntityType(body2,1);
PositionEntity(body2,Vec3(-0.7,0,0));
DebugPhysics(1);
light=CreateDirectionalLight();
RotateEntity(light,Vec3(45,45,45));
Collisions(1,1,1);
SetWorldGravity(Vec3(0,0,0));
TVec3 vector = Vec3(0,0,0);
std::string vinfo;
// Game loop
while( !KeyHit() && !AppTerminate() )
{
vector = TFormVector(Vec3(-2,0,0),body,body2);
// Update timing and world
UpdateAppTime();
UpdateWorld(AppSpeed()) ;
// Render
SetBuffer(gbuffer);
RenderWorld();
SetBuffer(BackBuffer());
RenderLights(gbuffer);
AddBodyForce(body,vector,1);
// Send to screen
Flip(0) ;
}
// Done
return Terminate() ;
}
It kinda seems to create an gravitation towords the one sphere.
-
i dont really understand how to use TFormVector().
TVec3 TFormVector(TVec3 &vector, TEntity src, TEntity dst)
What does it return? And what is the Source Entity and the Destination Entity?
-
What functions will allow me to do so?
-
How would it be possible to make gravity attract towords the center of a giant sphere to simulate a planet with LE?
And also, would it be possible to create some sort of event horizon around the sphere that makes the gravity attract when close enough, so it would be possible to create multiple "planets" who all have gravity?
Helicopter
in Programming
Posted
I am trying to make a little helicopter simulator.
I want to apply realistic physics ..
I just need some advice.
When creating a helicopter, should it consist of multiple bodies and should these be connected with pivots or what?
The thrust from the rotors should only effect the roters so they drag the aircraft to get a realistic effect.
Hope you know what i mean, i just need to know how to start constructing it, how to structure it and so on.