Skip to content

Commit ee49256

Browse files
committed
huge chungus , go mod file chnage github adedall file
1 parent 75c6e70 commit ee49256

File tree

24 files changed

+137
-137
lines changed

24 files changed

+137
-137
lines changed

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ package main
7171

7272
import (
7373
//...other imports
74-
"physix/pkg/vector"
74+
"github.com/rudransh61/Physix-go/pkg/vector"
7575
)
7676
```
7777

@@ -154,8 +154,8 @@ To create an instance of RigidBody you need to provide all the required fields .
154154
First Import these files,
155155
```golang
156156
import (
157-
"physix/internal/physics"
158-
"physix/pkg/rigidbody"
157+
"github.com/rudransh61/Physix-go/internal/physics"
158+
"github.com/rudransh61/Physix-go/pkg/rigidbody"
159159
)
160160
```
161161

@@ -177,7 +177,7 @@ To update position of a RigidBody, Use <b>ApplyForce</b> in a loop ,
177177
Example :-
178178
```golang
179179
for i := 0; i < 100; i++ {
180-
physix.ApplyForce(ball1, vector.Vector{X: 10, Y: 0}, dt) // Make the vector (0,0) to apply no force
180+
github.com/rudransh61/Physix-go.ApplyForce(ball1, vector.Vector{X: 10, Y: 0}, dt) // Make the vector (0,0) to apply no force
181181
// .. other code
182182
}
183183
```

examples/ex1.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@ import (
55
"fmt"
66
"time"
77

8-
"physix/internal/physics"
9-
"physix/pkg/rigidbody"
10-
"physix/pkg/vector"
11-
// "physix/internal/collision"
8+
"github.com/rudransh61/Physix-go/internal/physics"
9+
"github.com/rudransh61/Physix-go/pkg/rigidbody"
10+
"github.com/rudransh61/Physix-go/pkg/vector"
11+
// "github.com/rudransh61/Physix-go/internal/collision"
1212
)
1313

1414
func main() {
@@ -29,8 +29,8 @@ func main() {
2929
dt := 0.1 // Time step for simulation
3030

3131
for i := 0; i < 100; i++ {
32-
physix.ApplyForce(ball1, vector.Vector{X: 10, Y: 0}, dt)
33-
physix.ApplyForce(ball2, vector.Vector{X: 0, Y: 10}, dt)
32+
github.com/rudransh61/Physix-go.ApplyForce(ball1, vector.Vector{X: 10, Y: 0}, dt)
33+
github.com/rudransh61/Physix-go.ApplyForce(ball2, vector.Vector{X: 0, Y: 10}, dt)
3434

3535
fmt.Printf("Ball1: Position(%f, %f)\n", ball1.Position.X, ball1.Position.Y)
3636
fmt.Printf("Ball2: Position(%f, %f)\n", ball2.Position.X, ball2.Position.Y)

examples/ex10.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ import (
44
"github.com/hajimehoshi/ebiten/v2"
55
"github.com/hajimehoshi/ebiten/v2/ebitenutil"
66
"image/color"
7-
"physix/pkg/polygon"
8-
"physix/pkg/vector"
9-
"physix/internal/physics"
7+
"github.com/rudransh61/Physix-go/pkg/polygon"
8+
"github.com/rudransh61/Physix-go/pkg/vector"
9+
"github.com/rudransh61/Physix-go/internal/physics"
1010
)
1111

1212
var (
@@ -17,7 +17,7 @@ var (
1717
func update() error {
1818
// Apply a force to simulate gravity
1919
gravity := vector.Vector{X: 0, Y: 10}
20-
physix.ApplyForcePolygon(ball, gravity, dt)
20+
github.com/rudransh61/Physix-go.ApplyForcePolygon(ball, gravity, dt)
2121

2222
// Bounce off the walls
2323
if ball.Position.X < 0 || ball.Position.X > 400 {
@@ -31,7 +31,7 @@ func update() error {
3131
}
3232

3333
func draw(screen *ebiten.Image) {
34-
// Draw the ball using the physix engine's position
34+
// Draw the ball using the github.com/rudransh61/Physix-go engine's position
3535
// calculateCentroid calculates the centroid of a polygon given its vertices.
3636
for _, v := range ball.Vertices {
3737
ebitenutil.DrawRect(screen, v.X, v.Y, 10, 10, color.RGBA{R: 0xff, G: 0, B: 0, A: 0xff})
@@ -50,7 +50,7 @@ func main() {
5050

5151
vertices := []vector.Vector{{X: 100, Y: 50}, {X: 50, Y: 100}, {X: 50, Y: 50}, {X: 200, Y: 200}}
5252

53-
// Initialize a rigid body with your physix engine
53+
// Initialize a rigid body with your github.com/rudransh61/Physix-go engine
5454
ball = polygon.NewPolygon(vertices, 5.0, true)
5555

5656
// Run the game loop

examples/ex11.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
package main
22

33
import (
4-
"physix/pkg/polygon"
5-
"physix/pkg/vector"
6-
"physix/internal/collision"
4+
"github.com/rudransh61/Physix-go/pkg/polygon"
5+
"github.com/rudransh61/Physix-go/pkg/vector"
6+
"github.com/rudransh61/Physix-go/internal/collision"
77
"fmt"
8-
// "physix/internal/physics"
8+
// "github.com/rudransh61/Physix-go/internal/physics"
99
)
1010

1111
func main() {

examples/ex12.go

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@ import (
44
"github.com/hajimehoshi/ebiten/v2"
55
"github.com/hajimehoshi/ebiten/v2/ebitenutil"
66
"image/color"
7-
"physix/pkg/polygon"
8-
"physix/pkg/vector"
9-
"physix/internal/physics"
10-
"physix/internal/collision"
7+
"github.com/rudransh61/Physix-go/pkg/polygon"
8+
"github.com/rudransh61/Physix-go/pkg/vector"
9+
"github.com/rudransh61/Physix-go/internal/physics"
10+
"github.com/rudransh61/Physix-go/internal/collision"
1111
"fmt"
1212
)
1313

@@ -21,8 +21,8 @@ var (
2121
func update() error {
2222
// Apply a force to simulate gravity
2323
gravity := vector.Vector{X: 0, Y: 10}
24-
physix.ApplyForcePolygon(ball, gravity, dt)
25-
physix.ApplyForcePolygon(ball2, gravity, dt)
24+
github.com/rudransh61/Physix-go.ApplyForcePolygon(ball, gravity, dt)
25+
github.com/rudransh61/Physix-go.ApplyForcePolygon(ball2, gravity, dt)
2626

2727
if ball.Position.Y < 0 || ball.Position.Y > 400 {
2828
ball.Velocity.Y = -10
@@ -45,7 +45,7 @@ if collision.PolygonCollision(ball, ball2) {
4545

4646

4747
func draw(screen *ebiten.Image) {
48-
// Draw the ball using the physix engine's position
48+
// Draw the ball using the github.com/rudransh61/Physix-go engine's position
4949
// calculateCentroid calculates the centroid of a polygon given its vertices.
5050
for _, v := range ball.Vertices {
5151
ebitenutil.DrawRect(screen, v.X, v.Y, 10, 10, color.RGBA{R: 0xff, G: 0, B: 0, A: 0xff})
@@ -75,7 +75,7 @@ func main() {
7575

7676
vertices := []vector.Vector{{X: 250, Y: 50}, {X: 200, Y: 100}, {X: 200, Y: 50}, {X: 350, Y: 200}}
7777

78-
// Initialize a rigid body with your physix engine
78+
// Initialize a rigid body with your github.com/rudransh61/Physix-go engine
7979
ball = polygon.NewPolygon(vertices, 50, true)
8080
ball2 = polygon.NewPolygon( []vector.Vector{{X: 100, Y: 50}, {X: 50, Y: 100}, {X: 50, Y: 50}, {X: 200, Y: 200}}, 50, true)
8181
ball2.Velocity.X = 100

examples/ex13.go

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ import (
44
"github.com/hajimehoshi/ebiten/v2"
55
"github.com/hajimehoshi/ebiten/v2/ebitenutil"
66
"image/color"
7-
"physix/internal/physics"
8-
"physix/pkg/rigidbody"
9-
"physix/pkg/vector"
7+
"github.com/rudransh61/Physix-go/internal/physics"
8+
"github.com/rudransh61/Physix-go/pkg/rigidbody"
9+
"github.com/rudransh61/Physix-go/pkg/vector"
1010
// "log"
1111
)
1212

@@ -17,16 +17,16 @@ var (
1717

1818
func update() error {
1919
ball.ApplyTorque(1)
20-
// Update the physix simulation
21-
physix.ApplyForce(ball, ball.Force, dt)
22-
// physix.UpdateRotation(ball,dt)
20+
// Update the github.com/rudransh61/Physix-go simulation
21+
github.com/rudransh61/Physix-go.ApplyForce(ball, ball.Force, dt)
22+
// github.com/rudransh61/Physix-go.UpdateRotation(ball,dt)
2323

2424

2525
return nil
2626
}
2727

2828
func draw(screen *ebiten.Image) {
29-
// Draw the rectangle using the physix engine's position
29+
// Draw the rectangle using the github.com/rudransh61/Physix-go engine's position
3030
ebitenutil.DrawRect(screen, ball.Position.X, ball.Position.Y, 50, 50, color.RGBA{R: 0xff, G: 0, B: 0, A: 0xff})
3131
}
3232

@@ -35,7 +35,7 @@ func main() {
3535
ebiten.SetWindowSize(400, 400)
3636
ebiten.SetWindowTitle("Projectile Motion")
3737

38-
// Initialize a rigid body with your physix engine
38+
// Initialize a rigid body with your github.com/rudransh61/Physix-go engine
3939
ball = &rigidbody.RigidBody{
4040
Position: vector.Vector{X: 100, Y: 400},
4141
Velocity: vector.Vector{X: 30, Y: -20},

examples/ex14.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ import (
55
"fmt"
66
// "time"
77

8-
"physix/pkg/matrices"
8+
"github.com/rudransh61/Physix-go/pkg/matrices"
99

10-
// "physix/internal/collision"
10+
// "github.com/rudransh61/Physix-go/internal/collision"
1111
)
1212

1313
func main() {

examples/ex15.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@ import (
44
"github.com/hajimehoshi/ebiten/v2"
55
"github.com/hajimehoshi/ebiten/v2/ebitenutil"
66
"image/color"
7-
"physix/pkg/rigidbody"
8-
"physix/pkg/vector"
9-
"physix/internal/physics"
10-
"physix/internal/collision"
7+
"github.com/rudransh61/Physix-go/pkg/rigidbody"
8+
"github.com/rudransh61/Physix-go/pkg/vector"
9+
"github.com/rudransh61/Physix-go/internal/physics"
10+
"github.com/rudransh61/Physix-go/internal/collision"
1111
"math"
1212
"math/rand"
1313
// "fmt"
@@ -51,7 +51,7 @@ func checkwall(ball *rigidbody.RigidBody) {
5151
func update() error {
5252
gravity := vector.Vector{X: 0, Y: 15}
5353
for _, ball := range balls {
54-
physix.ApplyForce(ball, gravity, dt)
54+
github.com/rudransh61/Physix-go.ApplyForce(ball, gravity, dt)
5555
checkwall(ball)
5656
}
5757

examples/ex16.go

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@ import (
44
"github.com/hajimehoshi/ebiten/v2"
55
"github.com/hajimehoshi/ebiten/v2/ebitenutil"
66
"image/color"
7-
"physix/pkg/polygon"
8-
"physix/pkg/vector"
9-
"physix/pkg/rigidbody"
10-
"physix/internal/physics"
11-
"physix/internal/collision"
7+
"github.com/rudransh61/Physix-go/pkg/polygon"
8+
"github.com/rudransh61/Physix-go/pkg/vector"
9+
"github.com/rudransh61/Physix-go/pkg/rigidbody"
10+
"github.com/rudransh61/Physix-go/internal/physics"
11+
"github.com/rudransh61/Physix-go/internal/collision"
1212
"fmt"
1313
)
1414

@@ -22,8 +22,8 @@ var (
2222
func update() error {
2323
// Apply a force to simulate gravity
2424
gravity := vector.Vector{X: 0, Y: 10}
25-
physix.ApplyForcePolygon(ball, gravity, dt)
26-
physix.ApplyForce(ball2, gravity, dt)
25+
github.com/rudransh61/Physix-go.ApplyForcePolygon(ball, gravity, dt)
26+
github.com/rudransh61/Physix-go.ApplyForce(ball2, gravity, dt)
2727

2828
if ball.Position.Y < 0 || ball.Position.Y > 400 {
2929
ball.Velocity.Y = -10
@@ -45,7 +45,7 @@ if collision.CirclePolygonCollision(ball2, ball) {
4545

4646

4747
func draw(screen *ebiten.Image) {
48-
// Draw the ball using the physix engine's position
48+
// Draw the ball using the github.com/rudransh61/Physix-go engine's position
4949
// calculateCentroid calculates the centroid of a polygon given its vertices.
5050
for _, v := range ball.Vertices {
5151
ebitenutil.DrawRect(screen, v.X, v.Y, 10, 10, color.RGBA{R: 0xff, G: 0, B: 0, A: 0xff})
@@ -67,7 +67,7 @@ func main() {
6767

6868
vertices := []vector.Vector{{X: 250, Y: 50}, {X: 200, Y: 100}, {X: 200, Y: 50}, {X: 350, Y: 200}}
6969

70-
// Initialize a rigid body with your physix engine
70+
// Initialize a rigid body with your github.com/rudransh61/Physix-go engine
7171
ball = polygon.NewPolygon(vertices, 50, true)
7272
ball2 = &rigidbody.RigidBody{
7373
Position: vector.Vector{X: 0, Y: 0},

examples/ex17.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@ import (
66
"image/color"
77
"math/rand"
88
"math"
9-
"physix/internal/collision"
10-
"physix/internal/physics"
11-
"physix/pkg/rigidbody"
12-
"physix/pkg/vector"
9+
"github.com/rudransh61/Physix-go/internal/collision"
10+
"github.com/rudransh61/Physix-go/internal/physics"
11+
"github.com/rudransh61/Physix-go/pkg/rigidbody"
12+
"github.com/rudransh61/Physix-go/pkg/vector"
1313
)
1414

1515
var (
@@ -29,7 +29,7 @@ func update() error {
2929
// Apply gravity and handle wall collisions for all balls
3030
for _, ball := range balls {
3131
gravity := vector.Vector{X: 0, Y: 0}
32-
physix.ApplyForce(ball, gravity, dt)
32+
github.com/rudransh61/Physix-go.ApplyForce(ball, gravity, dt)
3333
checkWallCollision(ball)
3434
}
3535

0 commit comments

Comments
 (0)