Jump to content

Canardia

Developers
  • Posts

    4,127
  • Joined

  • Last visited

Everything posted by Canardia

  1. Framewerk doesn't create the graphics window, so it's up to you if you use fullscreen or windowed mode. Graphics(800,500); // windowed Graphics(1920,1080,32); // fullHD fullscreen
  2. I wouldn't say it's only for FPS, since also flight simulators, train simulators, submarine simulators, golf simulators, horse simulators, MMO, RPG, RTS, and all kind of games which need a realistic looking environment can use it. Maybe some commands for changing some shader settings could be added, but if the default values are correct and give a realistic looking scene, there is not much need for them either. I think many players don't want too much special effects either, if they give no benefit to the gameplay, but only lower FPS.
  3. @Marcus: It's not cross-platform in the conventional meaning. People expect under cross-platform that it runs at least on Mac and Linux (which would require OpenGL support). When an engine runs on Mac and Linux, it should run also on a few dozen more platforms, that is real meaning of cross-platform.
  4. It should still have its convex collision hull, but that works also when rotating it with TurnEntity(), it just won't get affected by other physics bodies, but the other physics bodies will.
  5. You need to save the DDS texture as DXT5 + generate MipMaps. Without MipMaps the engine doesn't show the texture at all.
  6. If you want to run your programs without Administrator account, you can put them under c:\users\username, which should be queried using the %userprofile% environment variable. As far I know, this is the only directory where the user can write files on Vista and Windows 7. It's similar in Linux, where the user has write access only to /home/username. This is needed when you publish your game, since most people don't want to risk their computer by running as Administrator. I don't know how commercial games do it, that they can write under "C:\Program Files (x86)\", at least in the installation phase they might ask for the Administrator password, but how they can write after that, must be some trick with native Windows API calls (where they grant the user write access to the directory). Actually there is also a DOS command to do that, if I remember right, so your installer might use that if you don't want to hardcode Windows API functions in your program.
  7. Thanks, that works much better, but if I do all attachments to the airplane this way, I lose all property dialogs in Editor. For example the smoke emitter is really nice to have in Editor, and not in code. I think I will just use TurnEntity() on the propeller, since Newton has a problem with high speed rotations also. The wheels can be done by code, as they don't need any adjustments in Editor. The engine exhaust smoke should be done in Editor, as it's too much coding to make particles by code.
  8. I tried to make a standalone LUA demo, and it works fine there, when I used Vec3(0,0,0) as position and Vec3(0,0,1) as pin. I can't figure out what's different in Editor. dofile("scripts/base.lua") RegisterAbstractPath("") Graphics(800,600) fw=CreateFramewerk() DebugPhysics(1) model=CreateBodyBox(1,1,4) pos=model:GetPosition() target=CreateBodyCone(1,1) target:Move(Vec3(0,0,-2.7)) target:Turn(Vec3(90,180,0)) fw.main.camera:SetPosition(pos) fw.main.camera:Turn(Vec3(0,-90,0)) fw.main.camera:Move(Vec3(0,0,-10)) model:SetMass(1) target:SetMass(1) SetBodyGravityMode(model,0) SetBodyGravityMode(target,0) CreateJointHinge(model,target,Vec3(0,0,0),Vec3(0,0,1)) while(KeyHit(KEY_ESCAPE)==0) do target:AddTorque(Vec3(0,1,0)) model:AddTorque(Vec3(0,2,0)) fw:Update() fw:Render() Flip(0) end
  9. You can use GetTarget(0) to get a target entity from another, and set a EntityKey in the target entity. I guess you could also use SendEntityMessage to send a message to the target, but that needs probably a bit more coding.
  10. I tried all combinations, but it still rotates model, when I rotate target around its Z axis: CreateJointHinge(model,target,Vec3(0,0,-1.67),Vec3(0,0,1)) CreateJointHinge(model,target,Vec3(0,0,-1.67),Vec3(0,0,-1)) -- maybe pin needs be outside of both bodies? CreateJointHinge(target,model,Vec3(0,0,-1.67),Vec3(0,0,1)) -- maybe target should be jointed to the model, and not vice versa? CreateJointHinge(target,model,Vec3(0,0,-1.67),Vec3(0,0,-1)) CreateJointHinge(model,target,Vec3(0,0,-30),Vec3(0,0,1)) -- maybe both position and pin needs to be outside both bodies?
  11. It should work, you should use AppLog("KEY SPACE DOWN") to see if it has any effect. Keypressed work only if you click on the Editor scene first, I click on the terrain so I don't select any objects.
  12. And if you just deleted model, you can't use it anymore. I thought you wanted to parent the body1 to the mesh, somehow like: EntityParent(entity,body1) Although I don't know right now how to get the mesh from the entity
  13. I found out why it didn't work for me: I used print("HELLO"), and not Print("HELLO"). print is the standard the LUA command, and it doesn't do anything with Editor, not even on the DOS console when Editor is started from the DOS command prompt.
  14. I don't know if the Pin is relative or absolute to the Position vector. Like I said, I'm just trying and guessing, since there is no documentation how joints should be used (not even on the Newton forum, and they don't have a wiki of the commands either).
  15. Something like FreeEntity(model), and then body1=CreateBodyBox() and EntityParent(mesh,body1).
  16. Delphi is more than Pascal, but it should understand everything what Pascal does. Pascal is like C, while Delphi is like C++. There is also Object Pascal and Turbo Pascal, which were earlier versions of Delphi, although I think Object Pascal goes it's own line. But for sure Delphi does also everything what Object Pascal does. It's like Pascal/Object Pascal in GNU standard, and Turbo Pascal and Delphi is Microsoft VC++ (just made by Borland instead). What's maybe more important to know is that Pascal supports also #ifdefs, so the same header files can be used for Delphi and Pascal.
  17. You probably can, but I think you need then to remove the Editor created static physics body first with LUA code (not from disk, but from the mesh).
  18. I think you shouldn't do that, but if you do, you need at least to set EntityType(body1,1). Although I think that command does not exist in LUA. You can't also use physics bodies with smaller than 0.1 dimensions, so your dimension of 0,0,0 will definitely not work. I use only physics shapes created with phygen, it makes life much easier as then I can control their mass and other settings from the properties dialog.
  19. Ah, I already thought there must be some smart solution like that
  20. I think it's more a general programming language convention, where either everything is lowercase, or everything starting with a capital letter (and in the middle also, seperating words). Sometimes there are also lowercase beginning letters, and then capital letters in the middle, but that's very ugly, like in Java and JavaScript. Normally in C everything is lowercase, and underscore is used as word seperator, but as nobody has a pure C compiler anymore, but a C/C++ compiler, and C has also developed a bit (to C99, which is almost like C++), where I think it's OK to use commands starting with capital letters, just like in C++, where it is the standard. I would use in LUA the same convention as in the C headers, which means everything starts with capital letters, and has them also as word seperators. It would mean that Vec3.X should be used.
  21. When using vec3, the coordinates should be noted with small letters (x,y,z), like GLSL does, and also NASA. When using Vec3, the coordinates should be noted with capital letters (X,Y,Z), like in the C/C++ headers, or Panda3D (although it's a pure C++ API, so it uses getX() and setX() instead). I find it a bit confusing, and hard to port code between LUA and C/C++, when LUA uses Vec3.x, and not vec3.x or Vec3.X.
  22. For the airplane: function Initialize() for model,entity in pairs(entitytable) do local target = model:GetTarget(0) if target~=nil then AppLog("TARGET 0 FOUND") pos = model:GetPosition() pos.y = pos.y + 0.02 pos.z = pos.z - 1.67 target:SetPosition(pos) rot = EntityRotation(model) target:SetRotation(rot) CreateJointHinge(model,target,Vec3(-1,0,-1.67),Vec3(0,0,-1.67)) end end end For the propeller: function UpdatePhysics(model) local entity,model for model,entity in pairs(entitytable) do if entity.active~=0 then model:AddTorque( Vec3( 0, 0, 100 ) ) end end end
  23. I tried to add a propeller to the rear of the airplane, but no matter how I joint it, it always rotates the airplane too, when I turn the propeller (model is the airplane, target is the propeller), and I try to turn the target around its Z axis: CreateJointHinge(model,target,Vec3(-1,0,-1.67),Vec3(0,0,-1.67)) A similar code works fine in C++, and I can turn the target around its Y axis: CreateJointHinge(model,target,Vec3(-1,3,0),Vec3(0,3,0)) Btw, a documentation how joints should be used would be also nice, so far I've been only guessing
  24. It would be logical to have model:SetRotation() and model:GetRotation(), since there is also model:GetPosition() and model:SetPosition(): pos = model:GetPosition() target:SetPosition(pos) rot = model:GetRotation() target:SetRotation(rot)
×
×
  • Create New...