Jump to content

ZioRed

Members
  • Posts

    1,133
  • Joined

  • Last visited

Everything posted by ZioRed

  1. I tried it with the sample crawler model and now it does not appear anymore on the Model Viewer (I already posted a comment reporting it) but still visible when loaded by code, didn't tried on the Editor, really I didn't noticed any difference in the picking delay.
  2. You can use a variable to hold the last frame and check it against the current one: TMesh _entity = LoadMesh("abstract::crawler.gmf"); float start = 131, end = 171; float startIdle = 0, endIdle = 69; float _frame = 0, _lastFrame = 0; int _playerState = 0; // Game loop while( !KeyHit() && !AppTerminate() ) { if (KeyHit(KEY_W)) { _playerState = 1; } if (_playerState) { _frame = AppTime() / 30.0; _frame = fmodf(_frame, end - start) + start; Animate(_entity, _frame); if (_lastFrame > _frame) { _playerState = 0; _lastFrame = 0; } else _lastFrame = _frame; } else { _frame = AppTime() / 30.0; _frame = fmodf(_frame, endIdle - startIdle) + startIdle; Animate(_entity, _frame); } UpdateAppTime(); UpdateWorld(); SetBuffer(buffer); RenderWorld(); SetBuffer(BackBuffer()); RenderLights(buffer); DrawText(0, 20, "Frame: %f", _frame); DrawText(0, 40, "Last: %f", _lastFrame); // Send to screen Flip(); }
  3. You have not attached the file, you need to manually click ATTACH FILE after selecting it and before clicking ADD SUBMISSION. I had the same problem in my first upload
  4. Shouldn't the weapon (and then the bullets) point to the center of screen when firing in 1st person (or at mouse click coords in 3rd person)?
  5. I usually use it, but it hasn't 2010 templates too EDIT: ops.. Roland posted before I clicked "send", well I'll wait for the new templates.
  6. Since 2010 express editions are spreading, I think it's almost a must to have their templates too in the Project Wizard. This should be an easy task, so it could be added in the next update(s).
  7. ZioRed

    GUI

    A goal already written on my notepad for next tasks is to create a GUI library which uses only LE commands like PGUI3 does (but for not NET platform), I'd like to have all inside the engine environment and not like much to add more dependencies to achieve what I can do (hardly or not) with engine commands.
  8. ZioRed

    GUI

    Masterxilo has written a tutorial for working with OpenGL and Rick was working on a CEGUI implementation on Leadwerks but I don't know what is its dev state.
  9. Ultimate Unwrap 3D can load/save MS3D format with the plugin, the list and button of plugins is at the bottom of Downloads page.
  10. Unfortunately this issue still occurs, most times it raises the AccessViolation exception (no matter calling or not RegisterAbstractPath before it). A quick test code for it: static void Main(string[] args) { Graphics.Initialize(800, 600); Framework.Initialize(false); Leadwerks.FileSystem.AbstractPath = "C:/Leadwerks Engine SDK"; string path = FileSystem.GetAbsolutePath("abstract::vehicle_monstertruck.gmf"); while (!Keyboard.KeyHit(Key.Escape) && !Leadwerks.Window.HasRequestedClose()) { Framework.Update(); Framework.Render(); Drawing.Text("Path: " + path, 0, 30); Graphics.Flip(); } Engine.Terminate(); } Inside the wrapper GetAbsolutePath only calls: return Core.AbstractPath(abstractPath) Anyone with engine source access could debug it when used with the wrapper? I'm available for quick testing on MSN (send me a PM to be added).
  11. +10k ;P GetCurrentFont() would be very useful in GUI development (that is my current pain task) for which I chose to continue/improve the PGUI3 library that uses only LE commands.
  12. Oops sorry I didn't noticed your last post
  13. Cannot simply use different collision types for the objects and so filter directly them with EntityPick (or also checking their entity type after picking)?
  14. Ok found, thanks, I will update the wrapper and add these operators too.
  15. Have you tried to free the trigger in the callback? void _stdcall TriggerCollision( TEntity triggerBody, TEntity entity, byte* position, byte* normal, byte* force, flt speed ) { if(GetEntityType(entity) == 1) { Trigger *trigger = (Trigger*) GetEntityUserData(triggerBody); trigger->level->ActivateTrigger(*trigger); delete trigger; } } The FreeEntityCallback example on wiki do it.
  16. From wiki: So I suppose you can only hide the model and then cycle through each of its children and manually Show them.
  17. No problem, we're here to help each others
  18. What is the correspondence of the C++ math operations among Vec3 objects on C#? This is an example taken from Gamelib (I am porting it to C# too): TVec3 force = Vec3(0.8f) * Vec3(GetBodyMass( pickedmodel )) * CalcBodyVelocity( pickedmodel, EntityPosition(handpivot) ); On C# I cannot multiply Vector3 objects. Do the operations on Vec3 mean the same operation applied to each item of the vector?
  19. It works with parenting too, the following test works: require("Scripts/constants/keycodes") --Register abstract path RegisterAbstractPath("") --Set graphics mode if Graphics(1024,768)==0 then Notify("Failed to set graphics mode.",1) return end world=CreateWorld() if world==nil then Notify("Failed to initialize engine.",1) return end gbuffer=CreateBuffer(GraphicsWidth(),GraphicsHeight(),1+2+4+8) camera=CreateCamera() camera:SetPosition(Vec3(0,0,-2)) mesh_parent = CreateCube() mesh_parent:SetColor(Vec4(0,0,1,1)) mesh_parent:Move(Vec3(0.5,0,0)) mesh=CreateCube() mesh:SetParent(mesh_parent) mesh:Move(Vec3(-1,0,0)) light=CreateDirectionalLight() light:SetRotation(Vec3(45,45,45)) while AppTerminate()==0 do if KeyHit(KEY_ESCAPE)==1 then break end if KeyHit(KEY_F5) == 1 then if EntityHidden(mesh) == 1 then mesh:Show() else mesh:Hide() end end UpdateAppTime() world:Update(AppSpeed()) SetBuffer(gbuffer) world:Render() SetBuffer(BackBuffer()) world:RenderLights(gbuffer) Flip(0) end
  20. You should declare the variable before the Main loop else it is not visible in the "else" code: local vwep = LoadMesh("abstract::object1.gmf") # ...begin main loop if KeyHit(KEY_F5)==1 then if showthing==0 then local object=0.6 vwep:SetParent(fw.main.camera,0) vwep:SetPosition(Vec3(-0.0*object,-0.01*object,0.45*object),0) vwep:Show() showthing=1 else vwep:Hide() showthing=0 end end # ...end main loop
  21. lol it's so fun that you ever cry against "C# The Devil". I think that Microsoft chose very good implementing a language so simple and powerful as C# and on the contrary I dislike enough C++, but it's only question of different views.
  22. Since I'm building an outdoor game I must wait for that function since I don't like this waste of resources (we will have several castles and towns on the map).
  23. That worked, thank you very much. "Infinite" means that even if the player is.. say.. 20-30km far away then the castle is however rendered and consumes resources?
  24. I have the model of a castle which disappears when the camera leaves a bit away (really few meters for its dimensions, I haven't measured but it is clear that something doesn't work there): It does not have any LOD and the following is its record in the SBX file: Model { path="castle2_castle.gmf" position=0.000000000,0.000000000,0.000000000 rotation=-0.000000000,-0.000000000,0.000000000 scale=1.00000000,1.00000000,1.00000000 id=222440568 "aligntoground"="0" "class"="Model" "collisiontype"="2" "friction"="0.500000000,0.500000000" "hidden"="0" "intensity"="1.0000000000000000" "mass"="0.00000000000000000" "name"="castle_2" "occlusionculling"="0" "order"="0" "viewdistance"="0.000000000,0.000000000" } Any thoughts about why it happens? Don't know if it is evident in the video, but the model of statue inside the castle is still visible when the castle suddenly disappears.
×
×
  • Create New...