shadmar Posted May 21, 2013 Share Posted May 21, 2013 I'm creating a spaceship that will have emitters based on a bone location emitting in the bone local direction. My spaceship has bones for every thruster with size location and direction. self.child = self.entity:FindChild("thruster_linear_1") if self.child then self.emitter = Emitter:Create(1000) self.emitter:SetEmissionVolume(Vec3(.01,.01,.01)); self.emitter:SetPosition(self.child:GetPosition()) self.emitter:SetVelocity(Vec3(self.child:GetRotation())) --this didin't work end Any ideas how I can proceeed to have the emitter emit along the bone vector and scale? Quote HP Omen - 16GB - i7 - Nvidia GTX 1060 6GB Link to comment Share on other sites More sharing options...
YouGroove Posted May 21, 2013 Share Posted May 21, 2013 I have used Matrix (the functions not the movie ) But what as lacking was functions to move relative to attach point and turn relative to it, all ith matrix functions. Search for my old post on "Matrix or attaching" Quote Stop toying and make games Link to comment Share on other sites More sharing options...
shadmar Posted May 21, 2013 Author Share Posted May 21, 2013 Found it thanks Quote HP Omen - 16GB - i7 - Nvidia GTX 1060 6GB Link to comment Share on other sites More sharing options...
shadmar Posted May 21, 2013 Author Share Posted May 21, 2013 It doesn't seem to matter what the vector of a bone is even if I use self.emitter:SetMatrix(self.child:GetMatrix() Quote HP Omen - 16GB - i7 - Nvidia GTX 1060 6GB Link to comment Share on other sites More sharing options...
shadmar Posted May 21, 2013 Author Share Posted May 21, 2013 Nah just me, got it, thanks. All good. Except for scale. Quote HP Omen - 16GB - i7 - Nvidia GTX 1060 6GB Link to comment Share on other sites More sharing options...
shadmar Posted May 21, 2013 Author Share Posted May 21, 2013 Scale works too, just need to type my problems and my brains starts to work. Quote HP Omen - 16GB - i7 - Nvidia GTX 1060 6GB Link to comment Share on other sites More sharing options...
shadmar Posted May 21, 2013 Author Share Posted May 21, 2013 Nice this now works : Emitter will align to bone by the y-axis (exported from UU3D) and scale to bone scale correctly. function Script:Start() self.entity:SetRotation(45,45,0); --rotate spaceship self.child = self.entity:FindChild("thruster1") --find thruster bone if self.child then self.emitter = Emitter:Create(1000) --create an emitter for it self.emitter:SetEmissionVolume(Vec3(0.1,4,0.1)); end end function Script:UpdateWorld() if self.child then self.entity:Turn(Time:GetSpeed()*0.02,Time:GetSpeed()*0.05,Time:GetSpeed()*0.03); self.emitter:SetMatrix(self.child:GetMatrix()) --align emitter to bone self.emitter:SetScale(self.child:GetScale()) --scale emitter by bone scale end end Quote HP Omen - 16GB - i7 - Nvidia GTX 1060 6GB Link to comment Share on other sites More sharing options...
Rick Posted May 22, 2013 Share Posted May 22, 2013 Bones have scale? I thought it was more like a pivot which is basically just a 3D point? Quote Link to comment Share on other sites More sharing options...
Admin Posted May 22, 2013 Share Posted May 22, 2013 They still have a scale value and a transformation space. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.