Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
/.gradle

/.idea
/build
*.iml
*.hprof
*.log
/local.properties
/deps
gradle
.run
Binary file added .gradle/8.0/checksums/checksums.lock
Binary file not shown.
Binary file added .gradle/8.0/checksums/md5-checksums.bin
Binary file not shown.
Binary file added .gradle/8.0/checksums/sha1-checksums.bin
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
package org.gradle.accessors.dm;

import org.gradle.api.NonNullApi;
import org.gradle.api.artifacts.MinimalExternalModuleDependency;
import org.gradle.plugin.use.PluginDependency;
import org.gradle.api.artifacts.ExternalModuleDependencyBundle;
import org.gradle.api.artifacts.MutableVersionConstraint;
import org.gradle.api.provider.Provider;
import org.gradle.api.model.ObjectFactory;
import org.gradle.api.provider.ProviderFactory;
import org.gradle.api.internal.catalog.AbstractExternalDependencyFactory;
import org.gradle.api.internal.catalog.DefaultVersionCatalog;
import java.util.Map;
import org.gradle.api.internal.attributes.ImmutableAttributesFactory;
import org.gradle.api.internal.artifacts.dsl.CapabilityNotationParser;
import javax.inject.Inject;

/**
* A catalog of dependencies accessible via the `libs` extension.
*/
@NonNullApi
public class LibrariesForLibs extends AbstractExternalDependencyFactory {

private final AbstractExternalDependencyFactory owner = this;
private final VersionAccessors vaccForVersionAccessors = new VersionAccessors(providers, config);
private final BundleAccessors baccForBundleAccessors = new BundleAccessors(objects, providers, config, attributesFactory, capabilityNotationParser);
private final PluginAccessors paccForPluginAccessors = new PluginAccessors(providers, config);

@Inject
public LibrariesForLibs(DefaultVersionCatalog config, ProviderFactory providers, ObjectFactory objects, ImmutableAttributesFactory attributesFactory, CapabilityNotationParser capabilityNotationParser) {
super(config, providers, objects, attributesFactory, capabilityNotationParser);
}

/**
* Returns the group of versions at versions
*/
public VersionAccessors getVersions() { return vaccForVersionAccessors; }

/**
* Returns the group of bundles at bundles
*/
public BundleAccessors getBundles() { return baccForBundleAccessors; }

/**
* Returns the group of plugins at plugins
*/
public PluginAccessors getPlugins() { return paccForPluginAccessors; }

public static class VersionAccessors extends VersionFactory {

public VersionAccessors(ProviderFactory providers, DefaultVersionCatalog config) { super(providers, config); }

}

public static class BundleAccessors extends BundleFactory {

public BundleAccessors(ObjectFactory objects, ProviderFactory providers, DefaultVersionCatalog config, ImmutableAttributesFactory attributesFactory, CapabilityNotationParser capabilityNotationParser) { super(objects, providers, config, attributesFactory, capabilityNotationParser); }

}

public static class PluginAccessors extends PluginFactory {

public PluginAccessors(ProviderFactory providers, DefaultVersionCatalog config) { super(providers, config); }

/**
* Creates a plugin provider for korge to the plugin id 'com.soywiz.korge'
* This plugin was declared in catalog libs.versions.toml
*/
public Provider<PluginDependency> getKorge() { return createPlugin("korge"); }

}

}
Binary file not shown.
Binary file not shown.
Empty file.
Binary file not shown.
Binary file added .gradle/8.0/executionHistory/executionHistory.lock
Binary file not shown.
Binary file added .gradle/8.0/fileChanges/last-build.bin
Binary file not shown.
Binary file added .gradle/8.0/fileHashes/fileHashes.bin
Binary file not shown.
Binary file added .gradle/8.0/fileHashes/fileHashes.lock
Binary file not shown.
Binary file added .gradle/8.0/fileHashes/resourceHashesCache.bin
Binary file not shown.
Empty file added .gradle/8.0/gc.properties
Empty file.
Binary file added .gradle/buildOutputCleanup/buildOutputCleanup.lock
Binary file not shown.
2 changes: 2 additions & 0 deletions .gradle/buildOutputCleanup/cache.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#Sat Mar 08 12:59:24 CET 2025
gradle.version=8.0
Binary file added .gradle/buildOutputCleanup/outputFiles.bin
Binary file not shown.
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
����
Binary file not shown.
Binary file not shown.
Empty file.
Binary file added .gradle/file-system.probe
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Empty file added .gradle/vcs-1/gc.properties
Empty file.
3 changes: 3 additions & 0 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[plugins]
korge = { id = "com.soywiz.korge", version = "4.0.1" }
#korge = { id = "com.soywiz.korge", version = "999.0.0.999" }
Binary file added gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
6 changes: 6 additions & 0 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.0-bin.zip
networkTimeout=10000
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
1 change: 1 addition & 0 deletions modules/korge-box2d/.gitarchive
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
v0.1.2
4 changes: 4 additions & 0 deletions modules/korge-box2d/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
/.idea
/.gradle
/build
/build.gradle
27 changes: 27 additions & 0 deletions modules/korge-box2d/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
-------------------------------------------------------------------------------
-- jbox2d license -------------------------------------------------------------
-------------------------------------------------------------------------------

Copyright (c) 2014, Daniel Murphy
All rights reserved.

Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:

* Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.

* Redistributions in binary form must reproduce the above copyright notice, this
list of conditions and the following disclaimer in the documentation and/or
other materials provided with the distribution.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
1 change: 1 addition & 0 deletions modules/korge-box2d/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
## Port of jbox2d
2 changes: 2 additions & 0 deletions modules/korge-box2d/kproject.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
dependencies:
- maven::common::com.soywiz.korlibs.korge2:korge
Original file line number Diff line number Diff line change
@@ -0,0 +1,129 @@
package korlibs.korge.box2d

/*
import korlibs.korge.view.ktree.*

@ThreadLocal
var KTreeSerializer.box2dWorld by Extra.PropertyThis<KTreeSerializer, Box2dWorldComponent?> { null }

object PhysicsKTreeSerializerExtension : KTreeSerializerExtension("physics") {
override fun complete(serializer: KTreeSerializer, view: View) {
//serializer.box2dWorld?.world?.forEachBody { println("it.linearVelocityY: ${it.linearVelocityY}") }
serializer.box2dWorld?.update(0.0.milliseconds)
serializer.box2dWorld?.world?.forEachBody {
if (!it.didReset) {
it.didReset = true
it.type = it.bodyDef.type
it.linearVelocityX = it.bodyDef.linearVelocity.x
it.linearVelocityY = it.bodyDef.linearVelocity.y
it.gravityScale = it.bodyDef.gravityScale
it.angularVelocity = it.bodyDef.angularVelocity
it.isSleepingAllowed = it.bodyDef.allowSleep
it.isAwake = it.bodyDef.awake
it.isFixedRotation = it.bodyDef.fixedRotation
it.isBullet = it.bodyDef.bullet
}
//println("it.linearVelocityY: ${it.linearVelocityY}")
}
}

override fun setProps(serializer: KTreeSerializer, view: View, xml: Xml) {
//println("PhysicsKTreeSerializerExtension.setProps")
val body = view.registerBodyWithFixture(
world = serializer.box2dWorld?.world,
type = xml.strNull("type")?.let { BodyType[it] } ?: BodyType.STATIC,
linearVelocityX = xml.float("linearVelocityX", 0f),
linearVelocityY = xml.float("linearVelocityY", 0f),
gravityScale = xml.float("gravityScale", 1f),
angularVelocity = xml.float("angularVelocity", 0f),
allowSleep = xml.boolean("isSleepingAllowed", true),
awake = xml.boolean("isAwake", true),
fixedRotation = xml.boolean("isFixedRotation", false),
bullet = xml.boolean("isBullet", false),
friction = xml.float("friction", 0f),
density = xml.float("density", 1f),
restitution = xml.float("restitution", 0f),
isSensor = xml.boolean("isSensor", false),
active = xml.boolean("isActive", true)
).body
body?.didReset = false
}

override fun getProps(serializer: KTreeSerializer, view: View): Map<String, Any?>? {
val body = view.body ?: return null
val fixture = body.m_fixtureList
//println("PhysicsKTreeSerializerExtension.getProps")
return LinkedHashMap<String, Any?>().apply {
if (body.type != BodyType.STATIC) this["type"] = body.type
if (body.linearVelocityX != 0f) this["linearVelocityX"] = body.linearVelocityX
if (body.linearVelocityY != 0f) this["linearVelocityY"] = body.linearVelocityY
if (body.gravityScale != 1f) this["gravityScale"] = body.gravityScale
if (body.angularVelocity != 0f) this["angularVelocity"] = body.angularVelocity
if (!body.isSleepingAllowed) this["isSleepingAllowed"] = body.isSleepingAllowed
if (!body.isAwake) this["isAwake"] = body.isAwake
if (body.isFixedRotation) this["isFixedRotation"] = body.isFixedRotation
if (body.isBullet) this["isBullet"] = body.isBullet
if (!body.isActive) this["isActive"] = body.isActive
if (fixture != null) {
if (fixture.isSensor) this["isSensor"] = fixture.isSensor
if (fixture.friction != 0f) this["friction"] = fixture.friction
if (fixture.density != 1f) this["density"] = fixture.density
if (fixture.restitution != 0f) this["restitution"] = fixture.restitution
}
}
}
}
fun ViewsContainer.registerBox2dSupportOnce() {
if (views.registeredBox2dSupport) return
views.registeredBox2dSupport = true
views.ktreeSerializer.registerExtension(PhysicsKTreeSerializerExtension)
views.viewExtraBuildDebugComponent.add { views, view, container ->
val physicsContainer = container.container {
}
fun physicsContainer() {
physicsContainer.removeChildren()
val body = view.body
if (body != null) {
physicsContainer.uiCollapsibleSection("Box2D Physics") {
button("Remove") {
onClick {
body.destroyBody()
view.body = null
body.view = null
physicsContainer()
}
}
uiEditableValue(body::type)
val fixture = body.m_fixtureList
if (fixture != null) {
uiEditableValue(fixture::isSensor)
uiEditableValue(fixture::friction)
uiEditableValue(fixture::density, min = 0f, clampMin = true, clampMax = false)
uiEditableValue(fixture::restitution)
}
uiEditableValue(body::linearVelocityX, min = -100f, max = 100f, clampMin = true, clampMax = false)
uiEditableValue(body::linearVelocityY, min = -100f, max = 100f, clampMin = true, clampMax = false)
uiEditableValue(body::gravityScale, min = -100f, max = 100f, clampMin = true, clampMax = false)
uiEditableValue(body::angularVelocity)
uiEditableValue(body::isSleepingAllowed)
uiEditableValue(body::isAwake)
uiEditableValue(body::isFixedRotation)
uiEditableValue(body::isBullet)
uiEditableValue(body::isActive)
}
} else {
physicsContainer.button("Add box2d physics") {
onClick {
view.registerBodyWithFixture(type = BodyType.STATIC)
views.debugSaveView("Add physics", view)
physicsContainer()
}
}
}
physicsContainer.root?.relayout()
}
physicsContainer()
}
//views.serializer.register()
}
*/
Loading