Skip to content

Commit

Permalink
Exposed add_boundaries parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
BenoitGeslain committed Jun 25, 2024
1 parent ab0335a commit ecc9e7b
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ public class ParametersToolkit : ScriptableObject {
[Tooltip("The weights used for the Razzaque2001Hybrid technique using the WeightedSum function.")]
public Vector3 HybridWeights = new(1f, 1f, 1f);


//
// 3D Interpolation
//
Expand All @@ -77,7 +76,8 @@ public class ParametersToolkit : ScriptableObject {
public float SmoothingParameter;
[Tooltip("Whether to apply rescaling before using thin-plate interpolation.")]
public bool Rescale;

[Tooltip("TODO")]
public bool add_boundaries = true;

//
// Pseudo-Haptic
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ namespace VHToolkit.Redirection.Interpolation3D {
public class Kohli2010RedirectedTouching : BodyRedirectionTechnique {

Func<Vector3, Vector3> displace = null;
bool add_boundaries = true;

/// <summary>
/// Compute the displacement vector field, which should be done only on init and whenever its parameters change for efficiency reasons.
Expand All @@ -28,7 +27,8 @@ public void ComputeDisplacement(Scene scene) {
scene.parameters.SmoothingParameter,
scene.parameters.Rescale
);
if (add_boundaries) {
Debug.Log(scene.parameters.add_boundaries);
if (scene.parameters.add_boundaries) {
var bounds = new Bounds(x[0], Vector3.zero);
foreach (var v in x.Concat(y)) {
bounds.Encapsulate(v);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ public override void OnInspectorGUI() {
if (actualTechnique == BRTechnique.Kohli2010RedirectedTouching) {
MakePropertyField(parametersObject.FindProperty("SmoothingParameter"), "Smoothing", "");
MakePropertyField(parametersObject.FindProperty("Rescale"), "Rescale", "");
MakePropertyField(parametersObject.FindProperty("add_boundaries"), "Add Boundaries", "");
}
else if (actualTechnique == BRTechnique.Geslain2022Polynom) {
// TODO broken
Expand Down

0 comments on commit ecc9e7b

Please sign in to comment.