Jump to content

All Activity

This stream auto-updates

  1. Today
  2. --Error here function me:StartPlayer() if me.mesh == nil then me.mesh = LoadModel(me.world,"Models/Developer/Generic/generic.mdl") me.mesh:SetPosition(0,0.15,0) me.collider = CreateCylinder(me.world, 0.3, 1.5, 16, 1, 1) me.collider:SetColor(1,0,0,0.1) me.collider:SetPosition(0,1.1,0) me.collider:SetMass(78) me.collider:SetCollisionType(COLLISIONTYPE_PLAYER,false) -- Close App. end end function me:StartCamera() if me.camera == nil then me.camera = CreateCamera(me.world) me.camera:SetDebugPhysicsMode(true) -- Error Here too.** me.camera:SetFov(75) me.pivotNeck = CreatePivot(me.world) me.camera:SetPosition(0, 0, -me.followdistance) -- Set initial position and eye height me.camera:SetRotation(0, 0, 0) me.pivotNeck:SetRotation(me.freelookrotation) -- Synchronize with freelook rotation me.camera:SetParent(me.pivotNeck, true) end end I have error when using the commands in Lua script. me.collider:SetCollisionType(COLLISIONTYPE_PLAYER,false) and me.camera:SetDebugPhysicsMode(true)
  3. For some reasons the terrain elevation returns allways 0. Im not sure if its a bug or if i did something wrong. void LootSpawner::SpawnLoot(shared_ptr<Terrain> terrain, shared_ptr<Map> scene, std::weak_ptr<Entity> player) { auto entity = GetEntity(); CreateDebugSpehere(entity->GetWorld(), scene, entity->position, Vec4(1.00, 0.07, 0.07, 1.0)); if (!prefabList.empty()) { for (int i = 0; i < this->itemCount; i++) { float degress = 360 / this->itemCount * i; auto radians = Radians(degress); auto distance = Random(diameterMin, diameterMax); auto sin = Sin(degress); auto cos = Cos(degress); float x = entity->GetPosition(true).x + distance * cos; float z = entity->GetPosition(true).z + distance * sin; float y = terrain->GetElevation(x, z); Print("Terrain height " + String(y)); int prefabIndex = Random(0, prefabList.size()); auto prefabName = prefabList[prefabIndex]; auto prefab = LoadPrefab(entity->GetWorld(), prefabName); prefab->SetPosition(x, y, z); auto lootCrate = prefab->GetComponent<LootCrate>(); lootCrate->SetPlayer(player); scene->AddEntity(prefab); CreateDebugSpehere(entity->GetWorld(), scene, Vec3(x, y, z)); } } this->spawned = true; } void LootSpawner::CreateDebugSpehere(shared_ptr<World> world, shared_ptr<Map> scene, Vec3 location, Vec4 color) { if (debug) { auto sourceSphere = CreateSphere(world); sourceSphere->SetColor(color); sourceSphere->SetPosition(location); scene->AddEntity(sourceSphere); } } bool LootSpawner::Load(table& properties, shared_ptr<Stream> binstream, shared_ptr<Map> scene, const LoadFlags flags) { itemCount = properties["itemCount"]; prefabs = properties["prefabs"]; diameterMin = properties["diameterMin"]; diameterMax = properties["diameterMax"]; auto player = scene->GetEntity(properties["player"]); prefabList = prefabs.Split(";"); for (auto entity : scene->entities) { if (entity->As<Terrain>()) { SpawnLoot(entity->As<Terrain>(), scene, player); } } return true; }
  4. 1. Create brush 2. Select face. 3. Apply texture: local texture = LoadTexture("/Materials/Developer/trigger.dds") local material = CreateMaterial() material:SetTexture(texture) local faces = program.facepanel:GetSelectedFaces() if (#program.facepanel:GetSelectedFaces() > 0) then for n = 1, #faces do local currentFace = faces[n] if currentFace ~= nil then currentFace:SetMaterial(material) currentFace:GetBrush():Build() end end return end 4. Select other face and apply other texture: local texture = LoadTexture("/Materials/Developer/grid01.dds") local material = CreateMaterial() material:SetTexture(texture) local faces = program.facepanel:GetSelectedFaces() if (#program.facepanel:GetSelectedFaces() > 0) then for n = 1, #faces do local currentFace = faces[n] if currentFace ~= nil then currentFace:SetMaterial(material) currentFace:GetBrush():Build() end end return end 5. Save map and open again Maps.zip Same for prefabs Also editor starts behave clunky after that - slow with delays and freezes
  5. Josh

    Viewport Bug

    I will need to order a 500 series card. I think someone else had another problem with this GPU...
  6. 0.9.6 Did some work on nav mesh updating in editor.
  7. Yesterday
  8. The documentation above says that the function will return zero if the two bodies are in motion, because the contact is not a force but an impulse. This is getting beyond my knowledge of physics. The best approximation I can think of is to take the normal and speed * speed of the collision times the other body's mass, and that's your kinetic energy, or "force".
  9. Perhaps something like this for tracking Entity::AddForce at least? The total force (including collision force) can only be retrieved from with the callback like you said. I more interested in knowing what the force is that is about to be applied to the physics object by code. MyComponent { virtual void PhysicsUpdateStart(float& applied_force_this_loop){ applied_force_this_loop = 0.0f; //Do what ever you want with the force that is about to be applied. } } //Maybe it could track what is being added? Entity::AddForce(Vec3 new_force){ applied_force_this_loop += new_force } //Once the physics update has completed End_PhysicsUpdate(){ //All entiites force can be reset to zero applied_force_this_loop = 0; } PhysicsUpdateStart could even be called from the torqueandforce callback - if it's thread safe... void callbackForceAndTorque(const NewtonBody* body) { auto total_force_ready_to_apply = 0; NewtonBodyGetForce(body, total_force_ready_to_apply); auto componet = body->GetUserData(); componet->PhysicsUpdateStart(total_force_ready_to_apply); NewtonBodyAddForce(body, total_force_ready_to_apply); }
  10. The collision includes the normal, which gives you the direction. I don't know how to get the "force" of a collision. This function does not: https://github.com/mmozeiko/Squares3D-Android/blob/dc7002d3e638a9ed0ffd090dc52168029321cec7/jni/newton/coreLibrary_200/source/newton/Newton.cpp#L2095
  11. This where a PhysicsUpdate() hook in the components or HOOK_PHYSICS_UPDATE would be great. It could have an argument called force.
  12. AddForce() could be called anywhere within the program, and how would I get the force applied by collision? The Collide function in the components only has speed. I need it for finding out the direction the object is being pulled in so I can align my player controller to gravity as it falls.
  13. Why would you need that, if you already have access to that information when it happens?
  14. 0.9.6 Fixed mesh layers not working correctly with depth prepass, will yield a significant performance increase.
  15. I think your right. So because there are two ways forces are applied it might not be possible for you to add a function that can get the applied force in last physics step?
  16. My pleasure. If you are happy with the result, reviews on Steam are always appreciated.
  17. Wow, you're fast! I have to say, this is pretty good customer service, lol. I see that you've got the export script working with brushes, too! That's really fantastic, it sounds like it'll do exactly what I was looking for. I can't wait to try it when I get home today. As for the terrain, I'm not bothered that it doesn't export along with the rest of the map geometry. If there's a way to export the heightmap, that's enough. Or even if there isn't, any external tool I'm using these glTF files in is sure to have a way to create heightmap terrain anyway. And the ability to tweak the editor colors, too, you really got it all covered! I really appreciate you doing this! I couldn't have hoped for a better response to my questions.
  18. Successfully exported a scene with brushes. Update will be available later today.
  19. In the next build, the editor will load the color scheme from the file "Ultra Engine/UI/Themes/dark.json". I don't recommend trying to convert to a light mode, because that would require different icons, but you can adjust the colors of the dark theme there. You will need to opt into the beta branch on Steam to get this update sooner:
  20. I have uploaded an extension to export the scene as a glTF file here: You can place that in your "Ultra Engine/Scripts/Start/Extensions" folder and it will work. Currently brush geometry does not get included in the export, but I think I can add that today...
  21. I think this is for processing forces right before they are applied. Forces can be applied two ways: Collision Programmatic In both cases, you have control over or access to the time that force is applied.
  22. This extension adds the option to export the current scene as a glTF file. Note that brushes currently will not be included in the exported file. ExportScene.lua
  23. Hi, Currently, the engine supports exporting a model as a glTF. It does not support exporting the whole scene as a glTF. However, it would not be difficult to create an editor extension that creates a temporary model, parents every entity in the scene to that model, and then saves that model as a glTF. I will give it a try now. Keep in mind that terrain and foliage cannot easily be exported to glTF. The color scheme is not currently user-editable, but if people want it would be easy for me to add a color scheme file the editor can load at startup.
  24. Small update, UAGC now has eye tracking! Only requirement is the RIG must contain a standard set of facial bones. If the bones are absent then the feature is automatically nulled out. I use the Paul Neale facial bone rig as it seems to be the most commonly used. But any rEye, lEye attached to head bone will do the trick.. it's not picky. https://paulneale.com/tutorials/facial-rigging-method-which-is-best-for-you-and-your-production/ All known bugs have been squashed, including a pesky jump/landing bug I've been tracking since early development. Added eye tracking and mild/light facial expression abilities ( controllable via a self:express() routine ). Added 3 new animation skeletons, short, normal and tall skeletons ( females ), males are on the way. Added ability to hot-swap the player mesh and stats in-game. No need to reload the entire map to load a new character! This should prove to be useful for games where the player controls more than one player type. ( self:playerswap(infos) ). Added eco-system, object pooling now active, started 3d sound controller. Laid out module blue prints for player pets, combat and cosmetic pets will be supported. Added Items Database. This database holds the following catagories for game items. Weapons ( Ranged, hand to hand, melee and magic ) Collectibles ( and items used by the upcoming quest system ). Useables ( includes powers, food/drink etc.. Anything that can be used then destroyed ) Misc - the section you can toss anything into that does not specifically fit any other catagory. Started the Ranged combat modules Added our first gun! The Splatter gun - used for testing out the combat module. Added 2 new playable female characters. ( Sasha and Jenna ). Fixed: Players feet no longer go below elevators/lifts base while moving. Lip moving ( npc talking ) and some moderate facial expressions are on the way. No time for a video this week, I got to leave out early.. Until next time !
  25. Similar to the newton function here I'd like to be able to get the amount of force applied to an entity in the last physics update. Entity::GetForce() or maybe Entity::GetAppliedForce()? I want to know what direction an object is being pulled - this is not always going to be the velocity. An object can be stationary yet still have a large force acting on it.
  1. Load more activity
×
×
  • Create New...