-
Posts
141 -
Joined
-
Last visited
Content Type
Blogs
Forums
Store
Gallery
Videos
Posts posted by GorzenDev
-
-
I am working on a third person controller with 'over the shoulder view', all thats left to do is camera collision/occlusion.
I do a world:pick from the camera's lookat target back to the camera, then check distance etc.
But the problem is my pick hits the character, or so it says.
I know this sounds like a noob problem and it may as well be for all i know.I set pickmode and collisiontype in the modelscript.
self.entity:SetPickMode(0, true) self.entity:SetCollisionType(Collision.None, true)
During picking i print some stuff.
local distance = -1.0 local pickInfo = PickInfo() if world:Pick(p0, p1, pickInfo, 0, true) then System:Print("camera occluded by: "..pickInfo.entity:GetClassName()) System:Print("name: "..pickInfo.entity:GetKeyValue("name")) System:Print("collisiontype: "..pickInfo.entity:GetCollisionType()) distance = p0:DistanceToPoint(pickInfo.position) end
The weird thing is the print results.
Quotecamera occluded by: Model
name:
collisiontype: 1I checked and collisiontype 1 = Collision:Prop.
How is it possible my model has collisiontype 1 ?
Could it be because my model has multiple surfaces ?Anybody has an idea?
-
thank you very much for pointing me in the right direction.
my apologies for posting this in the bug reports i realize this should have been posted in programming -
Creating a new project through the editor and compiling that straight away results in the same error.
somehow it has a problem with Leadwerks.lib(Face.obj) ???
I have not changed anything. -
After all these new little updates i no longer can compile any c++ project.
gives error:Quote1> Creating library E:\Projects\Leadwerks\CriminalMinds\Projects\Windows\..\..\CriminalMinds.debug.lib and object E:\Projects\Leadwerks\CriminalMinds\Projects\Windows\..\..\CriminalMinds.debug.exp
1>Leadwerks.lib(Face.obj) : error LNK2019: unresolved external symbol ___std_reverse_trivially_swappable_4 referenced in function "void __cdecl std::_Reverse_unchecked1<int *>(int * const,int * const,struct std::integral_constant<unsigned int,4>)" (??$_Reverse_unchecked1@PAH@std@@YAXQAH0U?$integral_constant@I$03@0@@Z)
1>E:\Projects\Leadwerks\CriminalMinds\Projects\Windows\..\..\\CriminalMinds.debug.exe : fatal error LNK1120: 1 unresolved externals
1>Done building project "CriminalMinds.vcxproj" -- FAILED.this a new project with all my codes commented out to make sure its not me.
this problem persist using 4.5 and even beta.
grabbing an older project and trying to compile, results in the same compile error. -
my Kaspersky doesnt find any virus in steam or leadwerks so might be a false positive.
-
if you are using vs2017 and have heap profiling enabled it will drop your fps significant
-
Does clamp get a proper result when negative values are used?
Since in that case the self.maxZoom would be the smallest value of the 2.
maiby flip them around ?
During optimisation i did at one point use clamp but got a bad result so reverted it back and never looked at it again. -
FYI the z index of mouseposition is cumulative.
To get proper values you could do something like:
local oldWheelPos = 0.0 if self.currentMousePos ~= nil then oldWheelPos = self.currentMousePos.z end self.currentMousePos = window:GetMousePosition() self.currentMousePos.x = Math:Round(self.currentMousePos.x) self.currentMousePos.y = Math:Round(self.currentMousePos.y) local newWheelPos = (self.currentMousePos.z - oldWheelPos) * 0.1 if newWheelPos > 0.0 or newWheelPos < 0.0 then self.curZoom = self.curZoom + newWheelPos if self.curZoom < self.maxZoom then self.curZoom = self.maxZoom elseif self.curZoom > self.minZoom then self.curZoom = self.minZoom end end
- 2
-
like aggrorjorn said.
but also take a look in menu.lua
you can also take a look at my blog its C++ but very similar to how you would use lua. -
i hope i understand your problem correctly.
But as i see it, you would have to manually set the color back to its original color. -
As it turned out i do have a high res mouse.
Updated mouse software, restarted and the issue is resolved.
Thank you guys for help.
my OS is win10 btw.Edit: back to 4.4 and all is oke
- 1
-
Hmm i did that just now and the problem persists..
actually starting to worry a bit now.
So this is what's happening in detail:
When pressing and holding right mouse button in the perspective viewport, the cursor gets hidden as it should.
Moving the mouse does not rotate the camera, better yet the mouse actually appears when moving outside the viewport rectangle.
-
I'm baffled as to where the problem may lay, like you said nothing has changed either in LE or on my PC.
I'm also reluctant to opt into beta and rather wait for stable release, as in my opinion developing a game with a version that is prone to (big)changes could end into more work for me.Using cpp so luckily the editor is only used during map development.
So for now i think i choose to wait and continue work on the map once 4.5 is no longer beta. -
after updating nvidia the issue still persists.
rebooting/restarting steam/pc did not fix the issue.
so im guessing updating to 4.5 is the only way to fix. -
Turning/Moving the camera in the perspective viewport stopped working for some reason.
It whas working fine yesterday.This is using leadwerks 4.4.
The things that do work is:
Panning/Zooming (scroll wheel).The things that dont work anymore:
Moving (ASWD).
Up/Down (QE).
Panning (Arrow Keys).
Is this a bug or did i accidentally change a option somewhere? (i've tried changing some options in config but no changes) -
6 hours ago, St0nedas said:
Hmm okay, but do you have any idea as to why it may be causing break points when I compile and run in release mode (At exactly when I assign the function pointer to the widget)? Because strangely enough it only happens *most* of the time ... sometimes it can run just fine, but runs fine every time in debug mode.
i am not sure to be honest i have never tried assigning a function pointer to a widget.
i usually just check event.source against a widget pointer and call a specific class function corresponding to that widget. -
as far as i know that is the only way.
-
I hope you find it usefull -
i am currently creating a tutorial blog where i try to explain as much as i can of what i found out playing with this system.
to be honest it all sounds more complex than it actually is.
the widget system gives you almost unlimited freedom as to what a GUI element does and how it reacts.- 1
-
a widget's functionality is always dictated by a lua script even if you dont use lua the widget does.
for example a Widget::Button() always uses the script "Scripts/GUI/Button.lua" unless you link it to a custom script.
so to say it plainly a widget always uses a lua script. -
your code creates a textarea which is differant from a textfield.
a textarea is always multiline.
a textfield is just one line.
setlayout works as supposed to just dont forget widget->Redraw() after setting layout.
also like josh said the basewidget needs a panel script.
if you dont want a visible panel you can always use SetObject('backgroundcolor', new Vec4(0,0,0,0)); to make it transparant. -
I wish we had lessons like these on school when i whas little, it would have saved me a lot of time teaching myself a certain way of thinking.
Also very helpfull for those that are new to programming or scripting.- 1
-
honestly looking at the vanilla TextArea.lua it looks like it should support what you want.
try something like below. (not tested it)function Script:AddText(text) self.updateslidersneeded=true local morelines = text:split("\n") local gui=self.widget:GetGUI() local n for n=1,#morelines do self.lines[#self.lines+1] = morelines[n] self.linewidth[#self.lines] = gui:GetTextWidth(morelines[n]) self.maxlinewidth = math.max(self.maxlinewidth,self.linewidth[#self.lines]) end --try something like this self:MouseWheel(#morelines) end
-
i feel nostalgic looking at this :D.
get a huge quake/unreal vibe.
[SOLVED]World:Pick problem against model with multiple surfaces.
in Programming
Posted
I have combined all my model surfaces into 1 surface and pick still returns prop collision.
I have checked every single entity in my scene and made sure none have a Collision:Prop.
I even went all the way and attached a script with pickmode(0) to every single brush and even all the skeleton bones.
It still returns the same result.
This is an impossible situation there is no way pick should return collision on something with collisiontype prop since there simple is nothing having that collision type in my scene.
"Frustration starts to build"
Nobody had similar problems and have an idea what could be wrong?