Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
get api in java
#1
Hi i try get api in java i don't remember how do it because i'am new user
but when i send script in plugins files i got lot or error
Smile
nice day
Reply
#2
If I weren't in vacation now I would send you a demo scene, but here's my project layout for Javascript usage:

(I moved the Curvy folder into PluginsSmile
/Plugins/Curvy/Base
/Plugins/Curvy/Examples
/Plugins/Curvy/Examples/ScriptsAndData
/Plugins/Editor (I moved the editor folder of the Curvy package here)
javascripttest.js (doesn't matter where you're javascript files are located, but they'll need to be outside Plugins)

This kind of problems are related to Unity, not Curvy. And you'll get this trouble with every other package written in C# as well. By having Curvy in a folder called "Plugins" you make sure that Curvy classes are compiled before your own scripts. Otherwise your scripts won't compile, as Curvy classes won't be usable then.

I recommend to read about the details here.
Reply
#3
it's work question about différence with spline Walker and Spline Walker Distance .
for i try do i need use the Spline Walker for Move by World units with distance start
i try add Spline Align but at launch he start to 0Smile
What's Initial F value ? in code he say the starting position

var script = car.GetComponent(SplineWalker);
script.TF = 200;

i try change him by script for see change but nothing
Reply
#4
Did you read about the differences in the docs?

TF always needs to be in the range 0..1, and InitialF is the starting position in TF. The different scales are explained here.
Reply
#5
Ok ! sorry noobs Inside ! !<< Smile)
thanks ! Smile) is help lot Smile


var script = Cur.GetComponent(CurvySpline);

pos =Vector3;
pos2 = 0.1f;
pos = script.GetTangentByDistance ( pos2 );

and she say
ArgumentOutOfRangeException: Argument is out of range.
Parameter name: index
System.Collections.Generic.List`1[CurvySplineSegment].get_Item (Int32 index) (at /Applications/buildAgent/work/b59ae78cff80e584/mcs/class/corlib/System.Collections.Generic/List.cs:633)
CurvySpline.DistanceToSegment (Single distance, System.Single& localDistance) (at Assets/plugins/Base/CurvySpline.cs:803)
CurvySpline.DistanceToTF (Single distance) (at Assets/plugins/Base/CurvySpline.cs:777)
CurvySpline.GetTangentByDistance (Single distance) (at Assets/plugins/Base/CurvySpline.cs:755)
CurvyNext.Awake () (at Assets/Scripts/CurvyNext.js:18)

same thinks with other like InterpolateByDistance
Reply
#6
(08-11-2013, 11:08 AM)kilik Wrote: Ok ! sorry noobs Inside ! !<< Smile)
thanks ! Smile) is help lot Smile


var script = Cur.GetComponent(CurvySpline);

pos =Vector3;
pos2 = 0.1f;
pos = script.GetTangentByDistance ( pos2 );

and she say
ArgumentOutOfRangeException: Argument is out of range.
Parameter name: index
System.Collections.Generic.List`1[CurvySplineSegment].get_Item (Int32 index) (at /Applications/buildAgent/work/b59ae78cff80e584/mcs/class/corlib/System.Collections.Generic/List.cs:633)
CurvySpline.DistanceToSegment (Single distance, System.Single& localDistance) (at Assets/plugins/Base/CurvySpline.cs:803)
CurvySpline.DistanceToTF (Single distance) (at Assets/plugins/Base/CurvySpline.cs:777)
CurvySpline.GetTangentByDistance (Single distance) (at Assets/plugins/Base/CurvySpline.cs:755)
CurvyNext.Awake () (at Assets/Scripts/CurvyNext.js:18)

same thinks with other like InterpolateByDistance

Do you have a screenshot of all Components of the affected GameObject? Or an example scene alternatively?
Reply
#7
[Image: 3ZtYm.jpg]
[Image: 3Zu6g.png]
[Image: 3Zu6g.png]

it's only one cubeSmile
Reply
#8
it's work ! yes sorry for that's
i need realy help here it's easy !

i'am on NGON and i try place object in space around

script1.SetOrientation = false;
obj.transform.eulerAngles = Vector3(0, 0, Random.Range(0,360));
Reply
#9
(08-12-2013, 04:00 PM)kilik Wrote: it's work ! yes sorry for that's
i need realy help here it's easy !

i'am on NGON and i try place object in space around

script1.SetOrientation = false;
obj.transform.eulerAngles = Vector3(0, 0, Random.Range(0,360));

See CurvySpline.GetExtrusionPoint(), that method calculates you a point on a virtual tube around the spline. Small example:
Code:
var radius=2;
var angle=180;
var pointAroundSpline=mySpline.GetExtrusionPoint(mySpline.Interpolate(0.5f), mySpline.GetTangent(0.5f), mySpline.GetOrientationUpFast(0.5f),radius, angle);
Reply
#10
It's aswome working very well
for fun i have try

var Curve :GameObject =GameObject.Find("Curvy");
var script = Curve.GetComponent(CurvySpline);
script.SwirlTurns =1;

var Curve2:GameObject =GameObject.Find("CurvyMeshPath");
var script2 = Curve2.GetComponent(SplinePathMeshBuilder);
script2.Refresh ();

and he look not refresh

another question in scale mode control point how i can obtient radius or maybie use curve for that i will see
Reply


Forum Jump: