DudeAwesome Posted January 16, 2014 Share Posted January 16, 2014 I dont like to create a "invisible" Material. is there a [x] invisble solution? Quote It doesn´t work... why? mhmmm It works... why? Link to comment Share on other sites More sharing options...
drakth Posted January 16, 2014 Share Posted January 16, 2014 If i remember correctly there is a material that is Inivisble in the assets, I cant check im not at home atm. Quote Link to comment Share on other sites More sharing options...
AggrorJorn Posted January 16, 2014 Share Posted January 16, 2014 Look at the tutorial project: Projects\MyGame\Materials\Effects\Invisible.mat Quote Link to comment Share on other sites More sharing options...
DudeAwesome Posted January 16, 2014 Author Share Posted January 16, 2014 So its only possible with an invisible material ? I am only interested in the shape to trigger a collision Quote It doesn´t work... why? mhmmm It works... why? Link to comment Share on other sites More sharing options...
AggrorJorn Posted January 16, 2014 Share Posted January 16, 2014 I don't know if this works: make a pivot. and adjust the physics. This is not as easy in my opinion as creating a CSG box. Quote Link to comment Share on other sites More sharing options...
DudeAwesome Posted January 16, 2014 Author Share Posted January 16, 2014 ahh good hint. a pivot with shapes should increase performance (vs. csg box with invisible material) I guess or I´m wrong? sure its not much but when its possible I will try not to waste resources Quote It doesn´t work... why? mhmmm It works... why? Link to comment Share on other sites More sharing options...
MisterGravity Posted January 16, 2014 Share Posted January 16, 2014 ahh good hint. a pivot with shapes should increase performance (vs. csg box with invisible material) I guess or I´m wrong? sure its not much but when its possible I will try not to waste resources I don't think it's easy to make a Pivot have a shape. Just try this: Draw a door and give it the SlidingDoor.lua Name: theSlidingDoor Mass 30.0 Collision Type: Scene Then draw a box in front of that door that will be the collision trigger to open it Name: slidingDoorTrigger CollisionTrigger.lua Mass 0.0 Collision Type: Trigger Change it's material to \Materials\Effects\Invisible Note, once you change it to invisible, the only way to see the box is to click on the toolbar: View / Show Physics Then, open the Flowgraph Editor and drag in theSlidingDoor and slidingDoorTrigger. Connect the Collision point of slidingDoorTigger to the Open point of theSlidingDoor. Voila. Quote I'm sure I'll have a million questions in my quest to master the Leadwerks Engine. Thank you for your patience. Link to comment Share on other sites More sharing options...
Rick Posted January 16, 2014 Share Posted January 16, 2014 I am only interested in the shape to trigger a collision Could you explain what difference it would matter? Certain engines have certain ways to doing things and this is really LE's way of doing volume triggers. The CSG has a shape and that's is what you are using. Then via the material you are telling the pipeline to not draw the visual part of the CSG. I don't think this slows anything down, so you'd have to ask yourself what difference does it really matter if this is how you accomplish this in LE. Quote Link to comment Share on other sites More sharing options...
ChrisV Posted January 16, 2014 Share Posted January 16, 2014 It would only matter if the invisible material needs a drawcall. The less drawcalls, the better. Does the invisible material require a drawcall, or not? I think Josh could shed some light on the matter. If it needs a drawcall for the invisible material, then maybe a better solution could be made? Quote My Artwork. ZBrush 4R7 64-bit - 3DCoat 4.5 BETA 12 - Fl Studio 12 64Bit - LE 3.2 Indie version - Truespace 7 - Blender 2.71 - iClone 5.51 Pro - iClone 3DXChange 5.51 pipeline - Kontakt 5 - Bryce 7 - UU3D Pro - Substance Designer/Painter - Shadermap 3 - PaintShop Photo Pro X7 - Hexagon - Audacity - Gimp 2.8 - Vue 2015 - Reaktor 5 - Guitar Rig 5 - Bitmap2Material 3 Link to comment Share on other sites More sharing options...
DudeAwesome Posted January 16, 2014 Author Share Posted January 16, 2014 Could you explain what difference it would matter? A material need resources to storage and there is a drawcall that "draw" the invisible material. I dont need both things in this case and it cost rendertime and storage in my RAM. the minimal information I need is: a nullpoint to find my trigger and 6 faces (6*2 =12 triangles) so I only have a nullpoint = 3 integers // x y z and 12 triangles (12*3= 36 vertices) = 3*36 = 108 integers (or less because some vertices are the same) (sure when I create objects there are more informations) for a cuboid trigger I would like to have something that isnt drawn in the world and just have shapes to detect collisions maybe a new entity? 2 Quote It doesn´t work... why? mhmmm It works... why? Link to comment Share on other sites More sharing options...
Rick Posted January 16, 2014 Share Posted January 16, 2014 Unless you are seeing any sort of drop in FPS from this (which I doubt) then I personally wouldn't worry about it. The amount of triggers you'll have compared to all the other stuff will most likely be very small. No need to optimize something that isn't causing you issues IMO. It may not be perfect, but very few things in games are. I can't imagine this would be any sort of high priority to Josh as there is a way to do it today that causes little to no slowdown to a game. I don't want to come off as being an *** or anything, but use what the engine has today to do something, and if it cause you problems then you'd have a better leg to stand on coming back to Josh and asking for a change. This is over optimizing something that I'm guessing isn't causing you any problems right now and may never cause you problems. 1 Quote Link to comment Share on other sites More sharing options...
DudeAwesome Posted January 17, 2014 Author Share Posted January 17, 2014 I got it now. triggering just with shapes is possible if someone is interested in: just add this script to a pivot object and move it to the position where you want the trigger. Size can be manipulated in the Script Tab Press L to show triggers in debug mode Script.Mapfile = "" --path Map Script.triggerSize = Vec3(1,1,1) --vec3 TriggerSize Script.triggerVisible = true --bool ShowTrigger function Script:Start() self.enabled=true if self.triggerVisible then --Create box self.box = Model:Box(self.triggerSize.x, self.triggerSize.y, self.triggerSize.z) self.box:SetPosition(self.entity:GetPosition().x, self.entity:GetPosition().y, self.entity:GetPosition().z) self.box:SetColor(0,1,0) end --Create shape self.entity:SetCollisionType(Collision.Trigger) self.shape = Shape:Box(0,0,0, 0,0,0, self.triggerSize.x, self.triggerSize.y, self.triggerSize.z) self.entity:SetShape(self.shape) self.shape:Release() end function Script:Collision(entity, position, normal, speed) if self.enabled then self.component:CallOutputs("Collision") System:Print("BAZINGA") if(self.Mapfile) ~= "" then --do a mapload end end end function Script:Enable()--in if self.enabled==false then self.enabled=true self:CallOutputs("Enable") end end function Script:Disable()--in if self.enabled then self.enabled=false self:CallOutputs("Disable") end end function Script:UpdateWorld() if DEBUG then if App.window:KeyHit(Key.L) then if self.box == nil then --Create box self.box = Model:Box(self.triggerSize.x, self.triggerSize.y, self.triggerSize.z) self.box:SetPosition(self.entity:GetPosition().x, self.entity:GetPosition().y, self.entity:GetPosition().z) self.box:SetColor(0,1,0) self.box:Hide() end if self.box:Hidden() then System:Print("Trigger on") self.box:Show() else System:Print("Trigger off") self.box:Hide() end end end end 1 Quote It doesn´t work... why? mhmmm It works... why? Link to comment Share on other sites More sharing options...
Rick Posted January 17, 2014 Share Posted January 17, 2014 I'm guessing you can't visually see how big this is in the editor? But it is a way around the invisible material way for sure. Quote Link to comment Share on other sites More sharing options...
DudeAwesome Posted January 17, 2014 Author Share Posted January 17, 2014 nope its not visible only in debug mode (press L) or if you turn triggerVisible to "true" @runtime the script should not taken too seriously I only wanted to test if it is possible Quote It doesn´t work... why? mhmmm It works... why? 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.