dsm-museum / artefact

ARtefact is a framework for displaying 3D models, adding annotations and connecting content to them. It is developed at the German Maritime Museum
https://dsm.museum
MIT License
2 stars 0 forks source link

import math class SaucerDrone: def __init__(self, num_motors=4): self.motors = [100] * num_motors self.battery = 100 self.altitude = 0 self.position = [0, 0] # [x, y] self.velocity = [0, 0] # [vx, vy] self.is_flying = False self.drag_coefficient = 0.1 def apply_drag(self): self.velocity[0] *= (1 - self.drag_coefficient) self.velocity[1] *= (1 - self.drag_coefficient) def move(self, dx, dy): if self.is_flying: self.velocity[0] += dx self.velocity[1] += dy self.apply_drag() self.position[0] += self.velocity[0] self.position[1] += self.velocity[1] self.battery -= 0.1 print(f"Moving to position: {self.position}") # Rest of the class remains the same #10

Open DannyFranklin opened 3 days ago

DannyFranklin commented 3 days ago

Describe the bug A clear and concise description of what the bug is.

To Reproduce Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior A clear and concise description of what you expected to happen.

Screenshots If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

Smartphone (please complete the following information):

Additional context Add any other context about the problem here.

DannyFranklin commented 3 days ago

import math

class SaucerDrone: def init(self, num_motors=4): self.motors = [100] * num_motors self.battery = 100 self.altitude = 0 self.position = [0, 0] # [x, y] self.velocity = [0, 0] # [vx, vy] self.is_flying = False self.drag_coefficient = 0.1

def apply_drag(self):
    self.velocity[0] *= (1 - self.drag_coefficient)
    self.velocity[1] *= (1 - self.drag_coefficient)

def move(self, dx, dy):
    if self.is_flying:
        self.velocity[0] += dx
        self.velocity[1] += dy
        self.apply_drag()
        self.position[0] += self.velocity[0]
        self.position[1] += self.velocity[1]
        self.battery -= 0.1
        print(f"Moving to position: {self.position}")

Rest of the class remains the same