Skip to content
Snippets Groups Projects
Commit 506719d5 authored by Natália Bebjaková's avatar Natália Bebjaková
Browse files

MeshPoint changed

parent dd9d348f
No related branches found
No related tags found
No related merge requests found
......@@ -128,18 +128,12 @@ public class MeshPoint {
return new MeshPoint(new Vector3d(newPosition), null, null);
}
/*public MeshPoint addPosition(MeshPoint b) {
return (new MeshPoint(new Vector3d(this.getPosition().x + b.getPosition().x,
this.getPosition().y + b.getPosition().y, this.getPosition().z + b.getPosition().z),
null, null));
}*/
/* public MeshPoint subtractPosition(MeshPoint b) {
return (new MeshPoint(new Vector3d(this.getPosition().x - b.getPosition().x,
this.getPosition().y - b.getPosition().y, this.getPosition().z - b.getPosition().z),
null, null));
}*/
/**
* returns new instance of MeshPoint with multiplied position by number
*
* @param number Number for multiplying
* @return multiplied MeshPoint
*/
public MeshPoint multiplyPosition(double number) {
if (normal != null) {
if (texCoord != null)
......@@ -156,6 +150,12 @@ public class MeshPoint {
null, null);
}
/**
* returns new instance of MeshPoint with divided position by number
*
* @param number Number for division
* @return divided MeshPoint
*/
public MeshPoint dividePosition(double number) {
if (normal != null) {
if (texCoord != null)
......@@ -169,11 +169,11 @@ public class MeshPoint {
this.getPosition().z / number), null, null);
}
/**
* Returns the cross product of two points.
@param meshPoint Second argument of the cross product operation.
* @return
@returns Point3D representing the resulting vector.
/**
* Returns the cross product of two points.
*
* @param meshPoint Second argument of the cross product operation.
* @return MeshPoint representing the resulting vector.
*/
public MeshPoint crossProduct(MeshPoint meshPoint) {
if (normal != null) {
......@@ -197,10 +197,21 @@ public class MeshPoint {
null, null);
}
/**
* returns the dot product of two points
*
* @param meshPoint Second argument of the dot product operation
* @return dot product of two instances of MeshPoint
*/
public double dotProduct(MeshPoint meshPoint) {
return (this.position.x * meshPoint.position.x + this.position.y * meshPoint.position.y + this.position.z * meshPoint.position.z);
}
/**
* returns absolute value of MeshPoint
*
* @return absolute value of MeshPoint
*/
public double abs() {
return Math.sqrt(this.getPosition().x * this.getPosition().x +
this.getPosition().y * this.getPosition().y + this.getPosition().z * this.getPosition().z);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment