The TLcyLspCameraLinkAddOn
comes with four tracking cameras by default.
you can override these, or add your custom set of tracking cameras.
To add a custom tracking camera:
-
Add a custom
ALcyCameraLinker
. To minimize the effort to provide a custom camera, two abstract subclassesALcyLspCameraLinker2D
andALcyLspCameraLinker3D
are available. They both implement some common code. A concrete implementation of one of those linkers is used to create a tracking camera constraint. You create such a constraint based on aALspTrackingPointProvider
, for example:@Override protected ALspCameraConstraint<TLspViewXYZWorldTransformation3D> createCameraConstraint(ALspTrackingPointProvider aTrackingPointProvider, ILspView aView) { TLspLookFromTrackingCameraConstraint3D constraint = new TLspLookFromTrackingCameraConstraint3D(false); constraint.setTrackingPointProvider(aTrackingPointProvider); return constraint; }
-
Add a custom
ALcyCameraLinkerFactory
. This factory must be able to produce one or more custom camera linkers. It can create these linkers based on a type, which is aString
value denoting which kind of tracking camera is requested.@Override public boolean canCreateCameraLinker(ILcyGenericMapComponent<? extends ILcdView, ? extends ILcdLayer> aMapComponent, String aType, List<Object> aObjects, List<ILcdModel> aModels) { return aMapComponent instanceof ILcyLspMapComponent && "FreeView".equals(aType); }
-
Add a custom add-on. This add-on, possible an extension of
TLcyLspCameraLinkAddOn
, must make sure that the custom factory is plugged-in.@Override public void plugInto(final ILcyLucyEnv aLucyEnv) { super.plugInto(aLucyEnv); //add a custom camera linker factory fLinkerFactory = new FreeViewLinkerFactory(); new TLcyCompositeCameraLinkerFactory(aLucyEnv).add(fLinkerFactory); } @Override public void unplugFrom(ILcyLucyEnv aLucyEnv) { super.unplugFrom(aLucyEnv); new TLcyCompositeCameraLinkerFactory(aLucyEnv).remove(fLinkerFactory); }
Note that if several plugged-in factories provide cameras of the same type, it is the factory plugged in with the highest priority that takes precedence.
-
Add a custom version of the
TLcyLspCameraLinkAddOn
's configuration file. This configuration file must contain two major elements:-
A list of supported camera linker types. The list adheres to these rules:
-
If a factory for a certain type is plugged into the Lucy back-end, but is not part of this list, it will not be taken into account.
-
If this list contains a type for which no factory is available, it will not be taken into account.
-
If this list contains a type for which a factory is plugged in, the add-on will pick it up.
-
-
A configuration for each active settable matching a custom camera linker type. If no such configuration exists, the camera linker type will not be supported.
-
Refer to the add-on configuration file for an example of how custom camera types can be configured.
If all these elements are added, the add-on will detect the custom camera linker and will make sure to provide it in the same way as it provides the default camera linkers.