Jump to content

Canardia

Developers
  • Posts

    4,127
  • Joined

  • Last visited

Everything posted by Canardia

  1. Actually Flexman is right, the gravitational pull makes heavier object fall faster. In addition there is no such thing as vacuum, as 90% of the universe is dark matter. Dark Matter has just the same kind of resistance as air, but of course much lower, so the shape and size of bodies matters also when they fall through dark matter.
  2. I was just adding wheels to my airplane, and noticed how much time the realtime LUA programming saves me when I was adjusting the positions of the wheels to their exact position. Having the airplane model positioned and zoomed on my screen, I added some code to load and position the wheels, and after each character change in code (like finding the value Vec3(0,0.125,2.01) for the front wheel), I pressed Ctrl-S and saw the result immediately on the screen. Using C++ or any other compiled language this would have taken me a lot more time, with all compiling and restarting between each adjustment. Even if I still need some C++ code for time critical things and 3rd party libraries, all the execute-once-at-startup code done with LUA reduces the amount of C++ code and programming time incredibly much. An industrial programmer who's getting paid for his work per hour, would probably save the company 50% of unnecessary expenses without that the programmer gets less salary, and the programmer would also get more motivated and have more time to focus on quality, since he is now so productive with Entity Oriented Realtime 3D Programming.
  3. I added the following lines to base.lua, and got body elasticity working via the properties dialog, but I would like the commands to be OOP style, and GetElasticity() is missing: Each line was added after the corresponding line with "sweptcollision": group:AddProperty( "Elasticity", PROPERTY_FLOAT ) elseif key=="elasticity" then return 1 --feature request: entity.model:GetElasticity() elseif key=="elasticity" then SetBodyElasticity(entity.model,value) --feature request: entity.model:SetElasticity(value)
  4. It means comparison for equality. A single = would be an assignment.
  5. From my experience how mass==1 objects behave in LE, it's very similar to 1kg objects in real life.
  6. 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
  7. 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.
  8. @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.
  9. 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.
  10. You need to save the DDS texture as DXT5 + generate MipMaps. Without MipMaps the engine doesn't show the texture at all.
  11. 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.
  12. 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.
  13. 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
  14. 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.
  15. 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?
  16. 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.
  17. 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
  18. 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.
  19. 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).
  20. Something like FreeEntity(model), and then body1=CreateBodyBox() and EntityParent(mesh,body1).
  21. 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.
  22. 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).
  23. 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.
  24. Ah, I already thought there must be some smart solution like that
  25. 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.
×
×
  • Create New...