<commit_before>package dae.prefabs.standard;

import com.jme3.asset.AssetManager;
import com.jme3.bullet.PhysicsSpace;
import com.jme3.bullet.collision.shapes.CylinderCollisionShape;
import com.jme3.bullet.control.RigidBodyControl;
import com.jme3.material.Material;
import com.jme3.math.FastMath;
import com.jme3.math.Quaternion;
import com.jme3.math.Vector3f;
import com.jme3.scene.Geometry;
import com.jme3.scene.shape.Cylinder;
import com.jme3.texture.Texture;
import dae.prefabs.Prefab;

/**
 *
 * @author <NAME>
 */
public class CylinderObject extends Prefab {

    private Geometry cylinder;
    private float radius = 0.5f;
    private float height = 1.0f;
    private int axialSegments = 6;
    private int radialSegments = 12;
    private AssetManager manager;
    private PhysicsSpace physicsSpace;

    public CylinderObject() {
        setPivot(new Vector3f(0, -radius, 0));
    }

    public CylinderObject(float radius, float height, int axialSegments, int radialSegments) {
        this.radius = radius;
        this.height = height;
        this.axialSegments = axialSegments;
        this.radialSegments = radialSegments;
        setPivot(new Vector3f(0, -height/2, 0));
    }

    @Override
    public final void create(String name, AssetManager manager, String extraInfo) {
        this.setName(name);
        this.manager = manager;
        recreateCylinder();
    }

    @Override
    public Prefab duplicate(AssetManager manager) {
        CylinderObject co = new CylinderObject( this.radius, height, axialSegments, radialSegments);
        co.physicsSpace = physicsSpace;
        co.create( name, manager, getObjectType(), null) ;
        co.setType( this.getType() );
        co.setCategory( this.getCategory() );
        return co;
    }

    @Override
    public String getPrefix() {
        return "Cylinder";
    }

    /**
     * @return the radius<commit_msg>create method adjusted to new definition.<commit_after>package dae.prefabs.standard;

import com.jme3.asset.AssetManager;
import com.jme3.bullet.PhysicsSpace;
import com.jme3.bullet.collision.shapes.CylinderCollisionShape;
import com.jme3.bullet.control.RigidBodyControl;
import com.jme3.material.Material;
import com.jme3.math.FastMath;
import com.jme3.math.Quaternion;
import com.jme3.math.Vector3f;
import com.jme3.scene.Geometry;
import com.jme3.scene.shape.Cylinder;
import com.jme3.texture.Texture;
import dae.prefabs.Prefab;

/**
 *
 * @author <NAME>
 */
public class CylinderObject extends Prefab {

    private Geometry cylinder;
    private float radius = 0.5f;
    private float height = 1.0f;
    private int axialSegments = 6;
    private int radialSegments = 12;
    private AssetManager manager;
    private PhysicsSpace physicsSpace;

    public CylinderObject() {
        setPivot(new Vector3f(0, -radius, 0));
    }

    public CylinderObject(float radius, float height, int axialSegments, int radialSegments) {
        this.radius = radius;
        this.height = height;
        this.axialSegments = axialSegments;
        this.radialSegments = radialSegments;
        setPivot(new Vector3f(0, -height/2, 0));
    }

    @Override
    public final void create(AssetManager manager, String extraInfo) {
        this.manager = manager;
        recreateCylinder();
    }

    @Override
    public Prefab duplicate(AssetManager manager) {
        CylinderObject co = new CylinderObject( this.radius, height, axialSegments, radialSegments);
        co.physicsSpace = physicsSpace;
        co.initialize( manager, getObjectType(), null) ;
        co.setName(name);
        co.setType( this.getType() );
        co.setCategory( this.getCategory() );
        return co;
    }

    @Override
    public String getPrefix() {
        return "Cylinder";
    }

    /**
     * @return the radius
{'fraction_non_alphanumeric': 0.10050118702189396, 'fraction_numerical': 0.013716697441308361, 'mean_word_length': 3.148796498905908, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6072121', 'n_tokens_mistral': 1224, 'n_tokens_neox': 1172, 'n_words': 269}