Microsoft
prefix
aaaaand
let controlSnake (kb:IKeyboard)=
controller {
let! move =
(kb.IsDown Keys.Up %? V3d.OIO %. V3d.OOO) %+
(kb.IsDown Keys.Down %? -V3d.OIO %. V3d.OOO) %+
(kb.IsDown Keys.Left %? -V3d.IOO %. V3d.OOO) %+
(kb.IsDown Keys.Right %? V3d.IOO %. V3d.OOO)
if move <> V3d.Zero then
return (fun _ -> move )
}
this produces an aFun, but Mod.integrate is looking for a list of AdaptiveFuncs. I guess I'm asking what the proper procedure for producing AdaptiveFunc? I couldn't find a way to make it from aFun, and the only way I saw to make one was through the 'adaptive' computation expression.
@dallinbeutler it seems Mod.integrate
is extension from here
AdaptiveFunc
in ModExtension
if there is afun
from base? @dallinbeutler
afun
@krauthaufen @haraldsteinlechner hey, what's purpose of
<DebugType>full</DebugType>
in rendering examples?
examples are generated by new.fsx and for some reason in the template this was activated. that is why it is everywhere, but honsetly i cannot imagin why it should be necessary
quick question. What's the difference between afun and AdaptiveFunc? I'm just trying to make a simple movement controller, and afun doesn't seem integrated with AdaptiveFunc or the Mod module. Should I be using the adaptive computation expression instead of controller?
I'm both glad and sorry trapped into controller troubles. Glad since contribution seems to be needed. Sorry because you found one of the darked holes so early. In fact camera controllers have a long history for krauthaufen and me - and unfortunately we regularly escalate somewhat in that matter. in retrospecive we remember from our adaptivefunc stuff that it is very correct in terms of timing. What we also found is that it is rather hard to work with (maybe just because of chaos and missing docu). I just looked it up, people most often use direct construction of AdaptiveFunc using adaptive blocks. i think this is the simpliefied last version which is used the most. So in the end the whole controller thing in rendering might not be that bad if there was better documentation.
Also, there could be potential in using a real FRP library.
The first versions of those controllers appear in logs in early 2015. in later 2015 afun appears in late 2015. So to sum up, in practice people tend to use adaptiveFunc (which is a->a i thing) since it might be easier to work with. I would suggest going this way?
win.Time
which is a Mod<DateTime>
. So for animations the official recommendation is to Mod.map on this time. An example which refines this approach with higher precision timing could for example be found here: https://github.com/aardvark-platform/aardvark.rendering/blob/master/src/Examples%20(netcore)/10%20-%20NBodyCompute/Program.fs#L201