Jump to content

Josh

Staff
  • Posts

    23,231
  • Joined

  • Last visited

Community Answers

  1. Josh's post in UpdatePhysics() was marked as the answer   
    PreUpdate() NewtonUpdate() PostUpdate() The collision world is an extra world for storing collision objects in. The World class has a Simulation object that can be cast to a NewtonDynamicsSimulation object, which contains a member for the Newton world.
  2. Josh's post in DrawImage() can not display what I want on game window was marked as the answer   
    Use the context size, not the window size.
  3. Josh's post in Type Data UserData? ( Lua ) was marked as the answer   
    This means that the variable is a C++ object.
  4. Josh's post in The scripts disappeared. :( was marked as the answer   
    Fortunately you uploaded an alpha and I can extract the scripts from that.
    You NEED to use a version control system. At the very least use DropBox, SVN is better.
  5. Josh's post in How can I change the color of a button? was marked as the answer   
    You will need to change the drawing code in the script. A button uses several colors.
  6. Josh's post in Memory Leaks?? Is Normal? was marked as the answer   
    There might be something in your box handling code that is causing a small mem leak, but I don't see anything very alarming there.
  7. Josh's post in How do I add a shader effect to the camera? was marked as the answer   
    Cast the entity to a camera object to access that function:
    https://www8.cs.umu.se/kurser/TDBD12/VT04/lab/lua/tolua++.html
    See tolua.cast.
  8. Josh's post in GetAnimationFinish()? was marked as the answer   
    No, but there is an EndAnimation script and actor function that will get called automatically:
    https://www.leadwerks.com/learn?page=Tutorials_Lua-Scripting_Introduction-to-Lua
  9. Josh's post in 4.6 Joints tilt when pushed by character controller was marked as the answer   
    The player will exert a force on objects it is standing on if the object has the "Scene" collision type. This is sort of a hack to make it so he exerts force on the see-saw puzzle. Try changing the platform collision type to "Prop".
  10. Josh's post in Transport a box? was marked as the answer   
    If you want the box to still collide with the level and be droppable, use a kinemetic joint like I did for the FPS script.  However, you might not want the player accidentally bumping into walls and dropping the box, in which case maybe you just need to make it smaller and parent it to the hands, with an animation for the upper body holding a box.
    Good gameplay and realism are sometimes different things, so I would not get stuck too hard on making the physics on that "realistic".
    Maybe he could simple carry the box over his head?
  11. Josh's post in Vector to Rotation was marked as the answer   
    The difficulty here is that a vector does not describe a 3D rotation. You need another term for roll, and your vector you used above demonstrates the exact problem, since it points straight up.
    Mat4 mat; mat.MakeDir(x,y,z) Quat rotation = mat.GetQuaternion() Note this will still have problems when pointing straight up.
  12. Josh's post in Entity::SetObject() was marked as the answer   
    A script must be assigned for an entity to contain script properties. Quick test:
     
    #include "Leadwerks.h" using namespace Leadwerks; int main(int argc, const char *argv[]) { Leadwerks::Window* window = Leadwerks::Window::Create(); Context* context = Context::Create(window); World* world = World::Create(); Camera* camera = Camera::Create(); camera->SetRotation(35, 0, 0); camera->Move(0, 0, -6); Light* light = DirectionalLight::Create(); light->SetRotation(35, 35, 0); //Create a model Model* model1 = Model::Box(); model1->SetPosition(-1, 0, 0); model1->SetColor(0.0, 0.0, 1.0); //Create a copy Model* model2 = (Model*)model1->Copy(); model2->SetPosition(1, 0, 0); model2->SetColor(0.0, 1.0, 0.0); //Lets modify some vertices to show the copy is unique Surface* surface = model2->GetSurface(0); surface->SetVertexPosition(0, -0.5, -2, -0.5); surface->UpdateAABB(); model2->UpdateAABB(Entity::LocalAABB | Entity::GlobalAABB); model1->SetScript("Scripts/null.lua"); model1->SetObject("TEST", surface); auto a = model1->GetObject("TEST"); Debug::Assert(a == surface); while (true) { if (window->Closed() || window->KeyDown(Key::Escape)) return false; Leadwerks::Time::Update(); world->Update(); world->Render(); context->Sync(); } }  
  13. Josh's post in Kinematic::Break() was marked as the answer   
    There are commands to set the max friction the joint can use. Set these to zero to disable the joint.
  14. Josh's post in Transform::Point was marked as the answer   
    Change this:
    Vec3 vg = Transform::Point(vp, model, NULL); To this:
    Vec3 vg = Transform::Point(vp, model->GetChild(0), NULL); Vertex positions are relative to the model they are part of.
  15. Josh's post in Error with graphics hardware was marked as the answer   
    Your graphics card is 11 years old, and is not supported.
  16. Josh's post in Camera Pitch Rotation problem was marked as the answer   
    The problem is that the Euler rotation returned by GetRotation in your UpdateCamera function is ambiguous. Try SetMatrix to replace SetRotation and SetPosition.
    --Adjust the camera orientation relative to entity function Script:UpdateCamera() self.camera:SetMatrix(self.entity:GetMatrix(true),true) self.camera:Move(0,1,0) end  
  17. Josh's post in A Question about navmesh was marked as the answer   
    To check if a point is inside the navmesh you could try to navigate to that point from another point you know is inside the navmesh.
    This command will return true if a path is successfully plotted:
    https://www.leadwerks.com/learn?page=API-Reference_Object_Entity_GoToPoint
  18. Josh's post in FBX problem was marked as the answer   
    We updated the FBX converter in version 4.5. In version 4.4 and before a different FBX converter was used. The old FBX converter is still available here:
    C:\Program Files (x86)\Steam\Steamapps\common\Leadwerks\Tools\fbx2mdl_old.exe
    If you rename that to "fbx2mdl.exe" then the editor will use it instead.
    I don't know any reason the new FBX converter would have a problem, but that is the only thing I can think of.
  19. Josh's post in How can I prevent the tyres from bouncing? was marked as the answer   
    Spring has new parameters:
    void Joint::SetSpring(const float spring, const float relaxation = 1.0f, const float damper = 0.1f)
  20. Josh's post in Tips to improve my vehicle with joints? was marked as the answer   
    Spring has new paramters:
    void Joint::SetSpring(const float spring, const float relaxation = 1.0f, const float damper = 0.1f)  
  21. Josh's post in PickInfo.triangle was marked as the answer   
    In the current build a sphere test (pick with radius) will not detect a single triangle.
    In the next version I am replacing the mesh picking code and a triangle will be detected when the radius is non-zero.
  22. Josh's post in Oculus Touch controller thumbsticks was marked as the answer   
    https://www.leadwerks.com/learn?page=API-Reference_Object_VR_GetControllerAxis
    Syntax
    Vec2 GetControllerAxis(number index, number button) Parameters
    index: The index of the controller, either Left or Right. button: The button to retrieve the axis value for. This can be TouchpadAxis, TriggerAxis, or GripAxis.
  23. Josh's post in AR was marked as the answer   
    We presently do not support any AR systems. It might still be possible for people to integrate these libraries into the professional edition without official support, but I don't know for sure.
  24. Josh's post in Full-screen while running was marked as the answer   
    Nope, you create a new context on your new window.
  25. Josh's post in Loading from the encrypted data file was marked as the answer   
    ReadFile will work on your own zip files. If the encrypted zip files could be read that would kind of defeat the purpose of encryption. ?
×
×
  • Create New...