mirror of
https://github.com/overte-org/overte.git
synced 2025-08-06 16:36:54 +02:00
Merge pull request #5056 from ericrius1/paint
marker ball now stays without mouse whether or not user is drawing
This commit is contained in:
commit
164df99f93
1 changed files with 9 additions and 4 deletions
|
@ -131,21 +131,22 @@ function MousePaint() {
|
||||||
|
|
||||||
|
|
||||||
function mouseMoveEvent(event) {
|
function mouseMoveEvent(event) {
|
||||||
if (!isDrawing) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
var pickRay = Camera.computePickRay(event.x, event.y);
|
var pickRay = Camera.computePickRay(event.x, event.y);
|
||||||
var addVector = Vec3.multiply(Vec3.normalize(pickRay.direction), DRAWING_DISTANCE);
|
var addVector = Vec3.multiply(Vec3.normalize(pickRay.direction), DRAWING_DISTANCE);
|
||||||
var point = Vec3.sum(Camera.getPosition(), addVector);
|
var point = Vec3.sum(Camera.getPosition(), addVector);
|
||||||
points.push(point);
|
|
||||||
Entities.editEntity(line, {
|
Entities.editEntity(line, {
|
||||||
linePoints: points
|
linePoints: points
|
||||||
});
|
});
|
||||||
Entities.editEntity(brush, {
|
Entities.editEntity(brush, {
|
||||||
position: point
|
position: point
|
||||||
});
|
});
|
||||||
|
if (!isDrawing) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
points.push(point);
|
||||||
path.push(point);
|
path.push(point);
|
||||||
|
|
||||||
if (points.length === MAX_POINTS_PER_LINE) {
|
if (points.length === MAX_POINTS_PER_LINE) {
|
||||||
|
@ -168,6 +169,10 @@ function MousePaint() {
|
||||||
}
|
}
|
||||||
|
|
||||||
function mousePressEvent(event) {
|
function mousePressEvent(event) {
|
||||||
|
if(!event.isLeftButton) {
|
||||||
|
isDrawing = false;
|
||||||
|
return;
|
||||||
|
}
|
||||||
lineRider.mousePressEvent(event);
|
lineRider.mousePressEvent(event);
|
||||||
path = [];
|
path = [];
|
||||||
newLine();
|
newLine();
|
||||||
|
|
Loading…
Reference in a new issue