_
This commit is contained in:
@@ -2,6 +2,9 @@ import pygame.draw
|
||||
|
||||
|
||||
class Circle:
|
||||
|
||||
object_type = "nr"
|
||||
|
||||
def __init__(self, center, radius, color, scene):
|
||||
self.center = center
|
||||
self.radius = radius
|
||||
|
@@ -2,6 +2,9 @@ import pygame
|
||||
|
||||
|
||||
class Ellipse:
|
||||
|
||||
object_type = "nr"
|
||||
|
||||
def __init__(self, center, a, b, color, scene):
|
||||
self.center = center
|
||||
self.a = a
|
||||
|
@@ -4,6 +4,9 @@ import math
|
||||
|
||||
|
||||
class EquilateralTriangle:
|
||||
|
||||
object_type = "nr"
|
||||
|
||||
def __init__(self, position, side_length, rotation, color, scene, width=0):
|
||||
self.position = position
|
||||
self.side_length = side_length
|
||||
|
@@ -5,6 +5,9 @@ import copy
|
||||
|
||||
|
||||
class Image:
|
||||
|
||||
object_type = "nr"
|
||||
|
||||
def __init__(self, center, scalar, path, scene):
|
||||
self.center = center
|
||||
self.scalar = scalar
|
||||
|
@@ -2,6 +2,9 @@ import pygame.draw
|
||||
|
||||
|
||||
class Line:
|
||||
|
||||
object_type = "nr"
|
||||
|
||||
def __init__(self, a, b, width, color, scene):
|
||||
self.a = a
|
||||
self.b = b
|
||||
|
@@ -2,6 +2,9 @@ import pygame
|
||||
|
||||
|
||||
class Text:
|
||||
|
||||
object_type = "nr"
|
||||
|
||||
def __init__(self, position, text, font_size, color, scene, font_name="calibri", bold=True):
|
||||
self.position = position
|
||||
self.text = text
|
||||
|
@@ -3,6 +3,9 @@ import pygame
|
||||
|
||||
|
||||
class RopeInteractiveDot:
|
||||
|
||||
object_type = "nr_c"
|
||||
|
||||
def __init__(self, position, r, color, force, forcefield_range, scene):
|
||||
self.position = position
|
||||
self.r = r
|
||||
@@ -25,7 +28,8 @@ class RopeInteractiveDot:
|
||||
if node.locked is False:
|
||||
if math.sqrt(sum((node.position - self.position) ** 2)) < self.forcefield_range:
|
||||
force_vector = node.position - self.position
|
||||
full_force_vector = (force_vector / math.sqrt(sum(force_vector ** 2))) * self.forcefield_range
|
||||
full_force_vector = (force_vector / math.sqrt(sum(force_vector ** 2))) \
|
||||
* self.forcefield_range
|
||||
force_vector = full_force_vector - force_vector
|
||||
force_vector /= self.forcefield_range / self.force
|
||||
|
||||
|
@@ -5,6 +5,8 @@ import math
|
||||
|
||||
class Rope:
|
||||
|
||||
object_type = "nr_d_i"
|
||||
|
||||
class Node:
|
||||
def __init__(self, position):
|
||||
self.position = position
|
||||
|
Reference in New Issue
Block a user