Home
News
Forum
Wiki
Blog
Contents
Gallery
Movies
Downloads
About NSL
[
List of Titles
|
List of Pages
|
New
|
Search
|
Recent changes
|
Help
]
OpenSim/Hack/SIM_boundary
[
Front page
]
[ ]
Start:
** SIM Boundary
- OpenSim/Region/Physics/OdePlugin/OdePlugin.cs
- Simulate() 関数内の actor.UpdatePositionAndVelocity() ...
if (actor != null) {
actor.UpdatePositionAndVelocity();
// by Fumi.Iseki for falling at SIM boundary
d.Vector3 vec = d.BodyGetPosition(actor.Body);
if (vec.Y<=0.0f || vec.Y>=255.95f || vec.X<=0.0f || v...
if (vec.Y<=0.0f) vec.Y = 0.1f;
else if (vec.Y>255.95f) vec.Y = 255.95f;
if (vec.X<=0.0f) vec.X = 0.1f;
else if (vec.X>255.95f) vec.X = 255.95f;
float height = GetTerrainHeightAtXY(Vec.X, Vec.Y);
if (actor.Flying) {
if (vec.Z < height + 2) {
vec.Z = height + actor.Size.Z/2;
actor.Velocity.Z = 0;
actor.IsColliding = true;
}
}
else {
if (vec.Z < height + actor.Size.Z/2) {
vec.Z = height + actor.Size.Z/2;
actor.Velocity.Z = 0;
actor.IsColliding = true;
actor.CollidingGround = true;
}
}
actor.Position = new PhysicsVector(vec.X, vec.Y, ...
d.BodySetPosition(actor.Body, vec.X, vec.Y, vec.Z...
}
}
End:
** SIM Boundary
- OpenSim/Region/Physics/OdePlugin/OdePlugin.cs
- Simulate() 関数内の actor.UpdatePositionAndVelocity() ...
if (actor != null) {
actor.UpdatePositionAndVelocity();
// by Fumi.Iseki for falling at SIM boundary
d.Vector3 vec = d.BodyGetPosition(actor.Body);
if (vec.Y<=0.0f || vec.Y>=255.95f || vec.X<=0.0f || v...
if (vec.Y<=0.0f) vec.Y = 0.1f;
else if (vec.Y>255.95f) vec.Y = 255.95f;
if (vec.X<=0.0f) vec.X = 0.1f;
else if (vec.X>255.95f) vec.X = 255.95f;
float height = GetTerrainHeightAtXY(Vec.X, Vec.Y);
if (actor.Flying) {
if (vec.Z < height + 2) {
vec.Z = height + actor.Size.Z/2;
actor.Velocity.Z = 0;
actor.IsColliding = true;
}
}
else {
if (vec.Z < height + actor.Size.Z/2) {
vec.Z = height + actor.Size.Z/2;
actor.Velocity.Z = 0;
actor.IsColliding = true;
actor.CollidingGround = true;
}
}
actor.Position = new PhysicsVector(vec.X, vec.Y, ...
d.BodySetPosition(actor.Body, vec.X, vec.Y, vec.Z...
}
}
Page:
Site Search
Advanced Search
Login
Username:
Password:
Lost Password?
Register now!!
Sub Menu
New Arrivals
Books
Web Links
Site Map
e-Learning
TUIS Certificate
mini Calendar
Nov 2024
Su
Mo
Tu
We
Th
Fr
Sa
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
Today
Who's Online
138 user(s) are online (65 user(s) are browsing xpwiki)
Members: 0
Guests: 138
more...
Access Counter
Today :
Yesterday :
Total :
Powered by XOOPS Cube 2.1© 2001-2006
XOOPS Cube Project
Design by
XoopsDesign.com