(edge {:keys [fromConstraintSegments colorDebug isConstrained originVertex
nextLeftEdge leftFace]
:as opts})
(find-path path-finder to-x to-y)
(find-path path-finder to-x to-y path)
Uses the path-finder to find a path from the path-finder's entity's current position to the destination. Will fill up and return an array, which can be reused, or shared with a LinearPathsampler.
Uses the path-finder to find a path from the path-finder's entity's current position to the destination. Will fill up and return an array, which can be reused, or shared with a LinearPathsampler.
(from-vertex-to-incoming-edges {:keys [fromVertex] :as opts})
(from-vertex-to-neighbour-vertices {:keys [fromVertex] :as opts})
(from-vertex-to-outgoing-edges {:keys [realEdgesOnly fromVertex] :as opts})
(graph-edge {:keys [prev next rotPrevEdge rotNextEdge oppositeEdge sourceNode
destinationNode data]
:as opts})
(img->image-data img)
Return an ImageData for a given <img> tag, using an in-memory canvas
Return an ImageData for a given <img> tag, using an in-memory canvas
(img->object img-element)
Convert a black-and-white bitmap image into an object that you can conj!
onto
your mesh. Takes a HTMLImageElement.
Convert a black-and-white bitmap image into an object that you can `conj!` onto your mesh. Takes a HTMLImageElement.
(debug-draw this)
(debug-draw this opts)
(next! this)
Move the entity one step closer to its destination. Updates entity.x / entity.y, returns nil.
Move the entity one step closer to its destination. Updates entity.x / entity.y, returns nil.
(next? this)
Is the entity still moving?
Is the entity still moving?
(set-destination this x y)
Set the destination for the entity, clearing out the current path.
Set the destination for the entity, clearing out the current path.
(set-location this x y)
Move the entity to a new location, this will clear out the current path. Use this instead of setting :x/:y on the entity directly, to prevent the path sampler from overwriting them on the next iteration.
Move the entity to a new location, this will clear out the current path. Use this instead of setting :x/:y on the entity directly, to prevent the path sampler from overwriting them on the next iteration.
(set-mesh this mesh)
Replace the mesh, this will clear the current path.
Replace the mesh, this will clear the current path.
(linear-path-sampler {:keys [entity count samplingDistance path] :as opts})
(object {:keys [pivotX pivotY scaleX scaleY rotation x y matrix coordinates
constraintShape hasChanged]
:as opts})
(pairs path)
The path finder returns a flat list of x and y values, turn this into [x y] pairs for easier processing.
The path finder returns a flat list of x and y values, turn this into [x y] pairs for easier processing.
(path-handler {:keys [entity mesh sampling-distance view]
:or {sampling-distance 5}})
Combined path-finder / path-sampler, hiding a bunch of implementation details,
and helping to keep these different stateful objects in sync.
See IPathHandler
for method definitions.
Combined path-finder / path-sampler, hiding a bunch of implementation details, and helping to keep these different stateful objects in sync. See [[IPathHandler]] for method definitions.
(polygon coords)
Construct a polygon from a sequence of [x y] coordinate pairs. Can be conj!
ed
onto a mesh.
Construct a polygon from a sequence of [x y] coordinate pairs. Can be `conj!`ed onto a mesh.
(rand-generator seed
rangeMin_
rangeMax_
{:keys [rangeMin rangeMax seed] :as opts})
(reset sampler-or-iterator)
Reset a linear-path-sampler or path-iterator
Reset a linear-path-sampler or path-iterator
(simple-view targetCanvas
{:keys [edgesColor edgesWidth edgesAlpha constraintsColor
constraintsWidth constraintsAlpha verticesColor
verticesRadius verticesAlpha pathsColor pathsWidth
pathsAlpha entitiesColor entitiesWidth entitiesAlpha
faceColor faceWidth faceAlpha]
:as opts})
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close