Jump to content

Yue

Members
  • Posts

    2,449
  • Joined

  • Last visited

Everything posted by Yue

  1. If you jump too high, you break your legs and die. xD
  2. These days I saw the PS5 trailer for The Matrix. And I'm left with a question: what do we consider real? The following image is a preset of a graphic mod called NBE Series for GTA V. What do you think about this, where do you think technology is going?
  3. The most complicated thing is to unite all the systems and make it work as expected, Ragdoll system + Animation system + Collisions + Character controller. This looks very good to me, and I'm already thinking of a way to make the character stand up. What do you think?
  4. Finish. We have made it, I thank my dad my mom my wife my family, for the love and hate patience I have had for Josh and his Leadwerks engine. But it doesn't end as long as we breathe and have internet. The next challenge is for our character to stand up. ( Josh's idea from a few months ago ) Whoever needs to implement this in their project, I receive money and do everything is difficult way through the underworld of Newtonian physics. That's how I ended up.
  5. This is great, for a long time I was bearing children ( suffering ) to try to get this algorithm out.
  6. Lemniscatta - Trovo Live ragdoll development.
  7. Hi, your comment made me think that life is not at all easy for some people. I start with my weaknesses and that is that I don't speak English, learning programming has meant learning to brute force certain concepts. And I have gone around different types of engines and the problem is always the same, documentation in English, although they say I am very smart I am really stubborn, I don't know when to stop something that really doesn't work for me. The other thing is as my grandfather used to say, we are the result of circumstances in life and possibly if life were different I would be doing great things with computers. But first there is food and shelter and family welfare, if this does not go well it would be impossible to sit down to create a work of art, or to study. Anyway, today I woke up philosophical. xD Translated with www.DeepL.com/Translator (free version)
  8. For today we leave it at that, we have rebuilt the whole system with what we have learned. And it looks like I can make this a reality.
  9. import("Scripts/Game/Player/CSkeletal.lua") CRagdoll={ Create = function(self,mesh) self.mesh = mesh --self.mesh:SetRotation(0,90,0) -- Test. self.mat = nil local this={} setmetatable(this,self) self.__index = self function this:Init() self.mesh = mesh self.mat = Material:Load("Materials/Effects/Invisible.mat") self.Skeletal = CSkeletal:Create(self.mesh) self:CreateMeshs() self:CreateShapes() self:SetRotation() self:CreateJoints() self:SetRotation() self:SetMass(10) System:Print(">>>### OBJETO RAGDOLL CREADO ###<<<") end function this:CreateJoints() self.Skeletal:GetPosBones() -- Trunk. self.jThoraxHead = Joint:Hinge(self.Skeletal.pHead.x,self.Skeletal.pHead.y,self.Skeletal.pHead.z, 1,0,0, self.mThorax, self.mHead) self.jStomachThorax = Joint:Hinge(self.Skeletal.pSpine1.x,self.Skeletal.pSpine1.y,self.Skeletal.pSpine1.z,1,0,0,self.mStomach, self.mThorax ) end function this:CreateMeshs() -- Trunk. self.mHead = Model:Box() self.mThorax = Model:Box() self.mStomach = Model:Box() -- Legs. self.mLegR = Model:Box() self.mLegL = Model:Box() self.mKneeR = Model:Box() self.mKneeL = Model:Box() self.mFootR = Model:Box() self.mFootL = Model:Box() self:FixRotLegs() self:SetScale() self:SetMaterial() self:SetPosition() end function this:SetScale() -- Trunk. self.mHead:SetScale(0.32,0.32,0.32) self.mThorax:SetScale(0.3,0.23,0.2) self.mStomach:SetScale(0.25,0.15,0.25) -- Legs. self.mLegR:SetScale(0.15,0.25,0.25) self.mLegL:SetScale(0.15,0.25,0.25) self.mKneeR:SetScale(0.15,0.25,0.25) self.mKneeL:SetScale(0.15,0.25,0.25) self.mFootR:SetScale(0.15,0.25,0.25) self.mFootL:SetScale(0.15,0.25,0.25) end function this:SetPosition() self.Skeletal:GetPosBones() -- Trunk. self.mHead:SetPosition(self.Skeletal.pHead,true) self.mThorax:SetPosition(self.Skeletal.pThorax,true) self.mStomach:SetPosition(self.Skeletal.pStomach,true) -- Legs. self.mLegR:SetPosition(self.Skeletal.pLegR,true) self.mLegL:SetPosition(self.Skeletal.pLegL,true) self.mKneeR:SetPosition(self.Skeletal.pKneeR,true) self.mKneeL:SetPosition(self.Skeletal.pKneeL,true) self.mFootR:SetPosition(self.Skeletal.pFootR,true) self.mFootL:SetPosition(self.Skeletal.pFootL,true) end function this:SetMaterial() self.mHead:SetMaterial(self.mat) self.mThorax:SetMaterial(self.mat) self.mStomach:SetMaterial(self.mat) end function this:SetRotation() self.Skeletal:GetRotBones() self.mHead:SetRotation(self.Skeletal.rHead,true) self.mThorax:SetRotation(self.Skeletal.rThorax,true) self.mStomach:SetRotation(self.Skeletal.rStomach,true) end function this:CreateShapes() self.shape = Shape:Sphere(0,0.5,-0.1) self.mHead:SetShape(self.shape) self.shape:Release() self.shape = Shape:Box(0,0.2,0) self.mThorax:SetShape(self.shape) self.shape:Release() self.shape = Shape:Box(0,0,-0.1) self.mStomach:SetShape(self.shape) self.shape:Release() end function this:SetMass(mass) -- Trunk. self.mHead:SetMass(0) self.mThorax:SetMass(mass) self.mStomach:SetMass(mass) -- Legs. self.mLegR:SetMass(mass) self.mLegL:SetMass(mass) self.mKneeR:SetMass(mass) self.mKneeL:SetMass(mass) self.mFootR:SetMass(mass) self.mFootL:SetMass(mass) end function this:FixRotLegs() self.Skeletal:GetRotBones() -- Legs. self.mLegR:SetRotation(self.Skeletal.rLegR,true) self.mLegL:SetRotation(self.Skeletal.rLegL,true) self.mKneeR:SetRotation(self.Skeletal.rKneeR,true) self.mKneeL:SetRotation(self.Skeletal.rKneeL,true) self.mFootR:SetRotation(self.Skeletal.rFootR,true) self.mFootL:SetRotation(self.Skeletal.rFootL,true) end function this:Update() self.Skeletal:GetRotBones() self.mesh:Turn(0,0.5,0) if Window:GetCurrent():KeyHit(Key.R) then self:SetRotation() end end this:Init() return(this) end } The ragdoll class, the interesting thing here is that when I press the R key, the joint adjusts according to where the character is facing, specifically the orientation of its bones.
  10. CSkeletal={ Create = function(self,mesh) self.mesh = mesh local this={} setmetatable(this,self) self.__index = self function this:Init() self.mmo = "bone:" self:ScanBones() System:Print(">>>### OBJETO SKELETAL CREADO ###<<<") end function this:ScanBones() -- Trunk self.bHead = self.mesh:FindChild(self.mmo .. "Head") self.bThorax = self.mesh:FindChild(self.mmo .. "Spine2") self.bSpine1 = self.mesh:FindChild(self.mmo .. "Spine1") self.bStomach= self.mesh:FindChild(self.mmo .. "Spine") -- Arms. self.bArmR = self.mesh:FindChild(self.mmo .. "RightArm") self.bArmL = self.mesh:FindChild(self.mmo .. "LeftArm") self.bElbowR = self.mesh:FindChild(self.mmo .. "RightForeArm") self.bElbowL = self.mesh:FindChild(self.mmo .. "LeftForceArm") self.bHandR = self.mesh:FindChild(self.mmo .. "RightHand") self.bHandL = self.mesh:FindChild(self.mmo .. "LeftHand") -- Legs. self.bLegR = self.mesh:FindChild(self.mmo .. "RightUpLeg") self.bLegL = self.mesh:FindChild(self.mmo .. "LeftUpLeg") self.bKneeR = self.mesh:FindChild(self.mmo .. "RightLeg") self.bKneeL = self.mesh:FindChild(self.mmo .. "LeftLeg") self.bFootR = self.mesh:FindChild(self.mmo .. "RightFoot") self.bFootL = self.mesh:FindChild(self.mmo .. "LeftFoot") end function this:GetPosBones() self.pHead = self.bHead:GetPosition(true) self.pThorax = self.bThorax:GetPosition(true) self.pStomach = self.bStomach:GetPosition(true) self.pLegR = self.bLegR:GetPosition(true) self.pLegL = self.bLegL:GetPosition(true) self.pKneeR = self.bKneeR:GetPosition(true) self.pKneeL = self.bKneeL:GetPosition(true) self.pFootR = self.bFootR:GetPosition(true) self.pFootL = self.bFootL:GetPosition(true) end function this:GetRotBones() self.rHead = self.bHead:GetRotation(true) self.rThorax = self.bThorax:GetRotation(true) self.rStomach = self.bStomach:GetRotation(true) self.rLegR = self.bLegR:GetRotation(true) self.rLegL = self.bLegL:GetRotation(true) self.rKneeR = self.bLegR:GetRotation(true) self.rKneeL = self.bKneeL:GetRotation(true) self.rFootR = self.bFootR:GetRotation(true) self.rFootL = self.bFootL:GetRotation(true) end this:Init() return(this) end } This is the first step, I have repeated this so many times that I already feel comfortable writing scripts in Lua. At this point I love to simulate object oriented programming in Lua. I think it is the best programming out there. This class called skeleton is to scan the bones of the mesh and their respective rotation and location in 3d space.
  11. Total mental anegation versus starting the process again in the main project. Wish me luck.
  12. it seems that this is working well, now comes the problem and it is to pass this prototype to the real project. At this point I'm going to get an engineering degree in ragdoll effect
  13. Things I am learning the hard way. Joints do not collide between the rigid bodies that make it up. However, it only happens with the two pieces that make up that joint. In my development process I have two joints coming out from the player's pelvis, one for the right leg and one for the left leg. Eventually the right leg (collision body) does not collide with the collision body of the pelvis. But if it is going to collide with the left leg, in the process of creating the joints these pieces collide with each other, two bodies cannot occupy the same space, and the dummy flies off like a pyre corn. The solution to this is that the two legs, upper part, should have a debris type collider. Translated with www.DeepL.com/Translator (free version)
  14. I discovered something, at the moment of moving the rigid bodies of the joint, the target cylinders have the collision prop, that's why the effect, however if I put the collision of those cylinders in Collision.None ( Simulating Ragdoll ). This does not happen anymore.
  15. Today I see light on the road, this is my test with Debris collision type and with Prop's it looks pretty good.
  16. I found the real hell of my problems, from the bottom of the pelvis of the model, the rotations the joints of the leg bones are different from the upper ones which are in a vector 3 of 0,0,0. At this point I had only one option and that was to rotate those bones manually for each animation, but that would kick me in the balls. However after seeing this image certain moment trying to figure out what I can do, I have a possible solution, and that is to rotate the rigid body of the collider to match that rotation of those joints. Let's wait how this goes. Translated with www.DeepL.com/Translator (free version) self.mLegR:SetRotation(self.bLegR:GetRotation(true)) self.mLegL:SetRotation(self.bLegL:GetRotation(true)) I do this effectively before creating the shapes.
×
×
  • Create New...